ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   End Macro If Cell Formula produces "#VALUE!" (https://www.excelbanter.com/excel-programming/346429-end-macro-if-cell-formula-produces-value.html)

slim[_3_]

End Macro If Cell Formula produces "#VALUE!"
 
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.



Gary Keramidas

End Macro If Cell Formula produces "#VALUE!"
 
you could use something like this

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

--


Gary


"slim" wrote in message
news:5P%gf.12128$Lw6.3130@trndny02...
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.




Bob Phillips[_6_]

End Macro If Cell Formula produces "#VALUE!"
 
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)


"slim" wrote in message
news:5P%gf.12128$Lw6.3130@trndny02...
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.





slim[_3_]

End Macro If Cell Formula produces "#VALUE!"
 
Excellent...works great...Thanks!
"Bob Phillips" wrote in message
...
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)


"slim" wrote in message
news:5P%gf.12128$Lw6.3130@trndny02...
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.








All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com