View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default To Check Errors for a range of cells

Sub FindErrors()
Dim myCell As Range
On Error GoTo NoErrors
For Each myCell In Range("E:E").SpecialCells(xlCellTypeFormulas, 16)
MsgBox "Cell " & myCell.Address & " has an error, so please fix it!"
Next myCell
Exit Sub
NoErrors:
MsgBox "No errors were found in column E."
End Sub

HTH,
Bernie
MS Excel MVP


"AccessHelp" wrote in message
...
Hi,

I want to write a code to check whether errors exist in column E. I use the
following code:

Dim r as Interger
r=9
r=r+1
If iserror(cells(r,5)) then
Msgbox "Please fix error"
else


Thanks. Please help.