Validate user inputted name.

  • Thread starter Thread starter DocBrown
  • Start date Start date
D

DocBrown

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
 
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
 
Back
Top