ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   InputBox (https://www.excelbanter.com/excel-programming/301168-inputbox.html)

banavas[_6_]

InputBox
 
Dear friends,
I want to check whether the entry in an inputbox is not error, nothin
or zero
I tried the following code but did not work.
Do you have any suggestions?
Thanks,
G

x = InputBox("Enter value of " & Range("B1").Value & ".", "GNB")

' Invalid entry
If IsError(x) Or IsEmpty(x) Or IsNull(x) Then
MsgBox ("Invalid Entry!")
x = InputBox("Enter Value of" & Range("B1").Value & "."
"GNB")
Print #1, "Value Entered for "; Range("B1").Value; " is "; x
End I

--
Message posted from http://www.ExcelForum.com


mangesh_yadav[_6_]

InputBox
 
Well, I can't imagine how a person will enter an error in the input box
but for the other two things (i.e. empty and zero) you can use th
following:

If (x = 0 Or x = "") Then

- Manges

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:30 AM.

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