Validation for Textbox in Userform

S

shahzad4u_ksa

Dear Sir,

I prepared one Userform, I want to validate the text field like this.

SEP<SPACE> 08 i.e. SEP 08 in capital letters.

what is the code for this purpose.

Waiting for your response..

Best Regards.

Syed Shahzad Zafar
 
R

Rick Rothstein \(MVP - VB\)

I am pretty sure there is more to your question than you have posted, but to
answer the question you asked...

If TextBox1.Text = "SEP 08" Then
MsgBox "Valid entry"
End If

Just to take a guess at what your ultimate question may be, is the "SEP" an
abbreviation for a month? If so, and if you want to check that the input is
a 3-character for an actual month, consider this...

For X = 1 To 12
If TextBox1.Text = UCase(MonthName(X, True)) Then
MsgBox "Valid entry"
Exit For
End If
Next

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top