View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lee Harris
 
Posts: n/a
Default Clearing #N/A's in one go?


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Lee

To add the ISNA wrapper to all VLOOKUP formulas after the fact....

Sub NATrapAdd()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=IF(ISNA*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=IF(ISNA(" & myStr & "),""""," & myStr & ")"
End If
End If
Next
End Sub


Gord Dibben Excel MVP


wow, thanks Gordon!

is that just added to any particular worksheet code with Alt-F11 or?