Hi,
I have a textbox1 within a userform that I would like to limit to a minimum of 18 characters.
If the textbox1 has less than 18 then I would like a message box to say so.
Any help would be much appreciated.
Kind Regards
Dan
Hi,
I have a textbox1 within a userform that I would like to limit to a minimum of 18 characters.
If the textbox1 has less than 18 then I would like a message box to say so.
Any help would be much appreciated.
Kind Regards
Dan
e.g.
![]()
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) With UserForm1 With .TextBox1 If Len(Trim(.Text)) < 18 Then Cancel = True MsgBox "Less than 18 characters, correct this" .SetFocus .SelStart = 0 .SelLength = .TextLength End If End With End With End Sub
Hi porucha vevrku,
that's worked perfectly, thank you so much.
Kind Regards
Dan
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks