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

Lee

ALT + F11 to open VB Editor

Select your workbook/project and right-click and insert module.

Place the code in that general module.

Save workbook.

ALT + Q to return to Excel workbook.

Macro can be run by ALT + F8 to open Macros or assigned to a button or
shortcut key combo.

If you want it to be available for all workbooks, place the Sub in your
Personal.xls.


Gord Dibben Excel MVP

On Tue, 22 Nov 2005 07:57:08 GMT, "Lee Harris" wrote:


"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?