Excel - Input mask issue

Ask a question

I would like to assign a custom input mask to a textbox like this:

Issue


"A.44.A.04.04"

Solution


Try this:
Dim lt As Long
lt = Len(TextBox1.Text)
If lt = 1 Or lt = 4 Or lt = 6 Or lt = 9 Then
  TextBox1.Text = TextBox1.Text & "."
End If



Thanks to ccm81 for this tip.
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team