View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Validate user inputted name.

check each character ?

return = inputbox()
bok =True
for index = 1 to len(return)
select case mid(return,1,1)
case in "abcdefghijklmnopqrstuv {and so on}"
case else
msgbox mid(return,1,1) & " is not allowed"
bOk =False
end select
if not bok then exit for
next
if bok then
msgbox "value ok"
else
msgbox "try again"
end if




"DocBrown" wrote in message
...
I can't find an answer to this.

Any ideas how I can validate the user input from an inputbox to insure
that
the name entered is a valid name, ie Name only contaings letters, numbers,
periods, and underscore, and begins with a letter, and is not a cell
reference type string.

I'm hoping I don't have to re-invent this vaildation routine and can use
something built in.

Thanks,
John