View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Kredlo Tim Kredlo is offline
external usenet poster
 
Posts: 11
Default testing for #NA with VBA

I am using VBA to loop through a range and if the cell contains an Excel
generated "#NA" I want to skip executing the functions in the loop.

To test for the "NA" I have tried the following:

If ActiveCell.Offset(idx1, 0).Value < "Error 2042" Then _
and
If ActiveCell.Offset(idx1, 0).Value < "#NA" Then _

and both give a "Run-time error '13': Type mismatch".

How can I test for an Excel generated '#NA' in a cell?

TIA
Tim Kredlo
Exterior Wood, Inc