Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox if Inputbox entry contains character
Hello. I have an app.inputbox piece of code below. I would like prevent
users from using an underscore ( _ ) in the input box. How can I modify the code below? Thank you! userinput = Application.InputBox("User Input") If userinput = False Then Exit Sub Else ***if userinput contains an underscore then msgbox ("cannot use underscores") vbokonly, then bring them back to the input box for re-entry else Run the rest of my code |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox if Inputbox entry contains character
Hi Steph,
Her you are Do userinput = Application.InputBox("User Input") Loop Until userinput = False Or InStr(1, userinput, "_") = 0 If userinput = False Then Exit Sub End If -- HTH Bob Phillips "Steph" wrote in message ... Hello. I have an app.inputbox piece of code below. I would like prevent users from using an underscore ( _ ) in the input box. How can I modify the code below? Thank you! userinput = Application.InputBox("User Input") If userinput = False Then Exit Sub Else ***if userinput contains an underscore then msgbox ("cannot use underscores") vbokonly, then bring them back to the input box for re-entry else Run the rest of my code |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with InputBox and MsgBox | Excel Discussion (Misc queries) | |||
Help with InputBox and MsgBox | New Users to Excel | |||
msgbox / inputbox etc | Excel Discussion (Misc queries) | |||
msgbox / inputbox etc | Excel Worksheet Functions | |||
Inputbox() Sum() MsgBox() | Excel Programming |