End Macro If Cell Formula produces "#VALUE!"

  • Thread starter Thread starter slim
  • Start date Start date
S

slim

I'd like to make a small error catch in a macro that will halt it if a
formula produces an error of #VALUE!

I was thinking something like this:

If Range("C25").Value = "#VALUE!" Then
MsgBox "Please Login before executing this macro"
Exit Sub
End If

Obviously my syntax is off. Can someone help me with this?

Thanks.
 
you could use something like this

If IsError(Range("a1")) Then
MsgBox "Please Login before executing this macro"
Exit Sub
End If
 
If IsError(Range("C25").Value) Then
MsgBox "Please Login before executing this macro"
Exit Sub
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Excellent...works great...Thanks!
Bob Phillips said:
If IsError(Range("C25").Value) Then
MsgBox "Please Login before executing this macro"
Exit Sub
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top