• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Allow only 10 digit in textbox

delta

Member
textbox 1 in userform contain only 10 digit number
not less than 10 digit or not more than 10 digit do this vba macro
how it work
 

mohadin

Active Member
Hi
some thing like
Code:
Private Sub TextBox1_AfterUpdate()
    If Len(TextBox1.Value) <> 10 Then
        TextBox1.Value = ""
        MsgBox "Invalid blabla" & vbLf & "Try again"
    End If
End Sub
 

Attachments

Top