title: Excel VBA Type Mismatch for #N/A
body: <p>I have this chunk of code</p>
  
  <pre><code>    With Data.Cells(rowMatch, GWECol)
          .Value = Cmp.Cells(i, GWENetPr)
          .AddComment
          .Comment.Text Text:=UCase(Environ("UserName")) &amp; ":" &amp; vbNewLine _
              &amp; "Comment: " &amp; Cmp.Cells(i, CommCol) &amp; vbNewLine _
              &amp; "Transaction: " &amp; Cmp.Cells(i, QRTran) &amp; vbNewLine _
              &amp; "QR Pr: " &amp; Cmp.Cells(i, QRPr) &amp; vbNewLine _
              &amp; "QR WD: " &amp; Cmp.Cells(i, QRWD) &amp; vbNewLine _
              &amp; "QR WD All: " &amp; Cmp.Cells(i, QRWDA) &amp; vbNewLine _
              &amp; "QR XPr: " &amp; Cmp.Cells(i, QRXPr) &amp; vbNewLine _
              &amp; "QR XAll: " &amp; Cmp.Cells(i, QRXAll) &amp; vbNewLine _
              &amp; "GWE Pr: " &amp; Cmp.Cells(i, GWEPr) &amp; vbNewLine _
              &amp; "GWE All: " &amp; Cmp.Cells(i, GWEAll) &amp; vbNewLine _
              &amp; "GWE XPr: " &amp; Cmp.Cells(i, GWEXPr) &amp; vbNewLine _
              &amp; "GWE XAll: " &amp; Cmp.Cells(i, GWEXAll)
          .Comment.Shape.TextFrame.AutoSize = True
      End With
  </code></pre>
  
  <p>Where the Cmp.Cells(i, X) refers to cells that may have #N/A error (a failed VLOOKUP).</p>
  
  <p>Is it possible to have the code just take in the #N/A as a string or just leave it empty? Right now, whenever one of the cells referenced is #N/A, the chunk will fail and no comment text will be added at all.</p>
  
  <p>Thanks!</p>