I wish to write vba code that finds occurrences of #N/A, #NAME, etc in Excel
spreadsheets.
Not very specific requirements, but the following should get you started:
Option Explicit
Sub foo()
Dim rStart As Range, rEnd As Range, c As Range
Set rStart = [A1]
Set rEnd = rStart.SpecialCells(xlCellTypeLastCell)
For Each c In Range(rStart, rEnd)
If IsError(c) Then
Debug.Print c.Address, c.Text
End If
Next c
End Sub
--ron