Your If..Then filters will not handle all incorrect entries. One example
(there are others), it will allow 1-23456 to be considered a valid phone
number. I would probably have written it something like this..
Private Sub MultiPage1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim X As Long
Dim PhoneNum As String
Dim TempPhoneNum As String
PhoneNum = Me.TextBox7.Text
TempPhoneNum = Space(Len(PhoneNum))
For X = 1 To Len(PhoneNum)
If IsNumeric(Mid(PhoneNum, X, 1)) Then
Mid(TempPhoneNum, X) = Mid(PhoneNum, X, 1)
End If
Next
PhoneNum = Format(Replace(TempPhoneNum, " ", ""), "(###) ###-####")
If Not PhoneNum Like "(*) ###-####" Then
MsgBox "Please enter a correct Phone Number"
Cancel = True
Me.TextBox7.SetFocus
Else
TextBox7.Value = Replace(PhoneNum, "() ", "")
End If
End Sub
Now I recognize there are some constructions above which you will be
unfamiliar with... check them out in the help files and try and work out how
they function... if you still have questions after that, feel free to post
back to this thread and ask them.