We Recommend

Visual Basic 2008 Programmer's Reference Visual Basic 2008 Programmer's Reference
Visual Basic Orcas Programmer's Reference is a language tutorial and a reference guide to the upcoming Orcas release of Visual Basic. The tutorial provides basic material suitable for beginners but also includes in-depth content for more advanced developers.


Posted By

neozhang on 01/31/08


Tagged

excel vba


Versions (?)


Avoid #N/A to Cause "Type Mismatch"


Published in: Visual Basic 


  1. Dim t as Long
  2.  
  3. If Application.IsNA(Application.VLookup(item, rng1, 10, 0)) Then
  4. t = 0
  5. Else
  6. t = ActiveCell.Offset(0, 51).Value
  7. End If
  8.  
  9. # use t instead of the cell value in the following calculation

Report this snippet 

You need to login to post a comment.