View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Checking number of characters in a TextBox

Try this...

If Not TextBox2.Text Like "???" Then
MsgBox "Sorry but you must enter your initials"
MultiPage1.Value = 0
GoTo MissingData
End If

You didn't show the rest of your code, so its hard to offer you an
alternative, but, personally, I would rather not see GoTo being used in code
like this except as part of an On Error GoTo statement.

--
Rick (MVP - Excel)


"Patrick C. Simonds" wrote in message
...
The code below check to ensure there is data in TextBox2 but I need to add
another If Statement to ensure that the number of characters in TextBox2
equals 3 characters.

If TextBox2.Text = "" Then 'Initials
MsgBox "Sorry but you must enter your initials"
MultiPage1.Value = 0
GoTo MissingData
End If