View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default validate entry via messagebox

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