Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to be able to ensure that an answer to a message box is either A,a,B
or b if anything else is entered the macro should display a message and exit the routine or re-display the message for a new entry. thanks Bill K |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A Message box does not allow for entry by a user. Assuming you mean InputBox
here is one method: Response = Application.InputBox("Enter a string". "Alpha Characters", Type:=2) While this will prevent returning numeric, date, time and other non-string data types, it does not restrict the entry to alpha characters. You would need to use scripting to construct a pattern to validate the entry against. I am just beginning to work with Scripting and have not developed that expertise as yet. "Bill Kuunders" wrote: I need to be able to ensure that an answer to a message box is either A,a,B or b if anything else is entered the macro should display a message and exit the routine or re-display the message for a new entry. thanks Bill K |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for that.
I eventually got some code working to go back to the input box if the entry was not an A a B or b Bill "JLGWhiz" wrote in message ... A Message box does not allow for entry by a user. Assuming you mean InputBox here is one method: Response = Application.InputBox("Enter a string". "Alpha Characters", Type:=2) While this will prevent returning numeric, date, time and other non-string data types, it does not restrict the entry to alpha characters. You would need to use scripting to construct a pattern to validate the entry against. I am just beginning to work with Scripting and have not developed that expertise as yet. "Bill Kuunders" wrote: I need to be able to ensure that an answer to a message box is either A,a,B or b if anything else is entered the macro should display a message and exit the routine or re-display the message for a new entry. thanks Bill K |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validate Entry | Excel Programming | |||
MsgBox to validate an entry | Excel Programming | |||
Validate InputBox entry | Excel Programming | |||
Validate textbox entry | Excel Programming | |||
Validate Combobox entry | Excel Programming |