banner_ad

taxt box properties in user form

Excel 1260 views 1 replies

can some one tell me how to specify properties of input by user in a text box used in user form ? I want to specify, say only dates or a PAN number. I want the user to receive error message if he feeds something else.

Replies (1)
to restrict textbox entry to date use following code Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) If TextBox1 = vbNullString Then Exit Sub If IsDate(TextBox1) Then TextBox1.Value = Format(TextBox1.Value, "MM / DD / YYYY") Else MsgBox "Please Enter Date " TextBox1 = vbNullString End If End Sub


CCI Pro

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
Featured ARTICLESHIP 19 March 2026
Article Assistant

Gupta Sachdeva & Co. Chartered Accountants

New Delhi

CA Final

View Details
Company
Featured 14 April 2026
GST CONSULTANT

Abhishek G Agrawal & Co.

Korba

CA Final

View Details
Company
Featured 28 March 2026
CA Final

Ashok Amol & Associates

New Delhi

CA Final

View Details
Company
Featured 13 April 2026
GST CONSULTANCY

Abhishek G Agrawal & Co.

Korba

CA Final

View Details
Company
Featured 28 March 2026
Accountant

Ashok Amol & Associates

New Delhi

B.Com

View Details
Company
Featured 29 April 2026
Manager- Finance and Compliance

Naveen Fintech Pvt Ltd

Kolkata

CA Inter

View Details