ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error Box (https://www.excelbanter.com/excel-programming/352670-error-box.html)

chalky[_13_]

Error Box
 

Simple problem i know but i am hitting a blank with this one. I have a
macro that reads:

If Range("N57") = "" Then
Else

Before the Else i want a warning box in there instead ot the do nothing
that is currently in there. I just want it to read something like
"Please Enter a Value".

any takers?


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=509435


Leith Ross[_539_]

Error Box
 

Hello Chalky,

Try using an InputBox...

If Range("M57") = "" Then
Answer = InputBox("Please enter a value.")
If Answer < "" Then Range("M57") = Answer
Else
....
End If

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=509435


Bob Phillips[_6_]

Error Box
 
Do
If Range("N57") = "" Then
Range("N57").Value = Inputbox("Please Enter a Value")
Else
'...
End If
Loop Until Range("N57").Value < ""

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"chalky" wrote in
message ...

Simple problem i know but i am hitting a blank with this one. I have a
macro that reads:

If Range("N57") = "" Then
Else

Before the Else i want a warning box in there instead ot the do nothing
that is currently in there. I just want it to read something like
"Please Enter a Value".

any takers?


--
chalky
------------------------------------------------------------------------
chalky's Profile:

http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=509435




Tom Ogilvy

Error Box
 
If Range("N57") = "" Then
MsgBox "Please Enter Value"
exit sub
Else


An Alternative

Dim as as Variant
If Range("N57") = "" Then
ans = InputBox("Please Enter a Value for ""N57""")
if not isnumeric(ans) then
exit sub
else
Range("N57").Value = ans
end if
End if

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy



"chalky" wrote in
message ...

Simple problem i know but i am hitting a blank with this one. I have a
macro that reads:

If Range("N57") = "" Then
Else

Before the Else i want a warning box in there instead ot the do nothing
that is currently in there. I just want it to read something like
"Please Enter a Value".

any takers?


--
chalky
------------------------------------------------------------------------
chalky's Profile:

http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=509435





All times are GMT +1. The time now is 08:39 PM.

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