Masks and Personalization in a "Text Box" of a VBA Form in Excel

Copper Contributor

Hi everyone!

It's my first time to make a form in Excel (I used to use Access) but I'm still new to these topics and haven't found anything about it to use in a vba excel form ...

What I need is:

In a Text Box of a Form made in VBA in Excel, the following:

1- A Date mask with format ../../../ .. Where the ".." would be the numbers to type.

2- A Numeric mask with format __-__-______-__ where the "_" would be the numbers to type.

3- Here it would already be a Personalization, and it is that when writing in a text field, the first letters of each word are put in Uppercase and the rest in lowercase automatically, for example: "Ricardo Alejandro Pérez"

Thank you all for your comments.

Greetings,

1 Reply

@DreamerMX 

There is no input mask feature for text boxes on a userform, unfortunately.

You can verify and modify the input after it has been entered, for example to convert the input to proper case:

Private Sub TextBox1_AfterUpdate()
    Me.TextBox1 = StrConv(Me.TextBox1, vbProperCase)
End Sub