View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H. Mike H. is offline
external usenet poster
 
Posts: 471
Default Textbox Data IsNumeric

If Len(tbxItemNumber) < 7 Then
'code you have
elseif left(tbxItemNumber,3)<"ADT" then
strPrompt ="Must start with ADT, etc...."
elseif mid(tbxItemNumber,6,1)<"-" then
strPrompt ="Must have a dash in position 6!"
end if


"RyanH" wrote:

I guess we all know that IsNumeric does not work 100% of the time when used
with Userform Textboxes. This is the format that I am looking for from the
users #####-# or ADT##-#. How can I ensure I have this format? This is what
I have so far:


' must have correct Item # to apply to schedule
If Len(tbxItemNumber) < 7 Then
strPrompt = "You must have a correct Item # to continue. It must be
" & _
"in this format: ''#####-#''"
intButtons = vbCritical
MsgBox strPrompt, intButtons, strTitle
DataValidator = True
Exit Function
End If

--
Cheers,
Ryan