Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply conditions on Input box continuation!
Hi all!
Thanks for the tips. Well I tried them but here'z the problem. I tried the following with the intention of letting the user type i ONLY numeric values as the Input. ============================================== Sub MF () MyNum = InputBox("Enter the area multiplication factor") If Not IsNumeric(MyNum) Then MsgBox "Invalid Entry! The multiplication factor entered is not numeric. " Exit Sub endif end sub ============================================== But when the 'Cancel' or 'OK' button are hit, Excel thinks those ar non-numeric too and displays the very same message above and it simpl exits of the loop. I dont want the program to display " Invalid Entry! The multiplicatio factor entered is not numeric. " when the 'Cancel' or 'OK' button ar hit. It should simply exit the loop without displaying any message. Is there a way we can do this? Thanks again guys. Regds, Arun.... Vtec Corp. p.s: ==== I did try the other options like the following: mynum = Application.InputBox _ ("Enter the area multiplication factor", Type:=1) Still the same thing..... -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply conditions on Input box continuation!
Sub MF ()
MyNum = InputBox("Enter the area multiplication factor") if MyNum = "" then exit sub If Not IsNumeric(MyNum) Then MsgBox "Invalid Entry! The multiplication factor entered is not numeric. " Exit Sub endif -- Regards, Tom Ogilvy "aiyer " wrote in message ... Hi all! Thanks for the tips. Well I tried them but here'z the problem. I tried the following with the intention of letting the user type in ONLY numeric values as the Input. ============================================== Sub MF () MyNum = InputBox("Enter the area multiplication factor") If Not IsNumeric(MyNum) Then MsgBox "Invalid Entry! The multiplication factor entered is not numeric. " Exit Sub endif end sub ============================================== But when the 'Cancel' or 'OK' button are hit, Excel thinks those are non-numeric too and displays the very same message above and it simply exits of the loop. I dont want the program to display " Invalid Entry! The multiplication factor entered is not numeric. " when the 'Cancel' or 'OK' button are hit. It should simply exit the loop without displaying any message. Is there a way we can do this? Thanks again guys. Regds, Arun.... Vtec Corp. p.s: ==== I did try the other options like the following: mynum = Application.InputBox _ ("Enter the area multiplication factor", Type:=1) Still the same thing...... --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How many conditions can I apply to a cell? I need to apply 8. | Excel Discussion (Misc queries) | |||
Adding today's date if certain conditions apply | Excel Worksheet Functions | |||
Summing if several conditions apply | Excel Worksheet Functions | |||
How to apply conditions on Input box? | Excel Programming | |||
cell = null if conditions apply | Excel Programming |