Excel - Input mask issue

January 2017


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.

Related


Published by aakai1056. Latest update on April 26, 2012 at 07:36 AM by aakai1056.
This document, titled "Excel - Input mask issue," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).