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

%3CLINGO-SUB%20id%3D%22lingo-sub-2832449%22%20slang%3D%22en-US%22%3EMasks%20and%20Personalization%20in%20a%20%22Text%20Box%22%20of%20a%20VBA%20Form%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2832449%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone!%3C%2FP%3E%3CP%3EIt's%20my%20first%20time%20to%20make%20a%20form%20in%20Excel%20(I%20used%20to%20use%20Access)%20but%20I'm%20still%20new%20to%20these%20topics%20and%20haven't%20found%20anything%20about%20it%20to%20use%20in%20a%20vba%20excel%20form%20...%3C%2FP%3E%3CP%3EWhat%20I%20need%20is%3A%3C%2FP%3E%3CP%3EIn%20a%20Text%20Box%20of%20a%20Form%20made%20in%20VBA%20in%20Excel%2C%20the%20following%3A%3C%2FP%3E%3CP%3E1-%20A%20Date%20mask%20with%20format%20..%2F..%2F..%2F%20..%20Where%20the%20%22..%22%20would%20be%20the%20numbers%20to%20type.%3C%2FP%3E%3CP%3E2-%20A%20Numeric%20mask%20with%20format%20__-__-______-__%20where%20the%20%22_%22%20would%20be%20the%20numbers%20to%20type.%3C%2FP%3E%3CP%3E3-%20Here%20it%20would%20already%20be%20a%20Personalization%2C%20and%20it%20is%20that%20when%20writing%20in%20a%20text%20field%2C%20the%20first%20letters%20of%20each%20word%20are%20put%20in%20Uppercase%20and%20the%20rest%20in%20lowercase%20automatically%2C%20for%20example%3A%20%22Ricardo%20Alejandro%20P%C3%A9rez%22%3C%2FP%3E%3CP%3EThank%20you%20all%20for%20your%20comments.%3C%2FP%3E%3CP%3EGreetings%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2832449%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New 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