Upper case in textbox

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Hi all,

How do I set up a userform when i exit textbox1 it automatically changes the
text in the box to uppercase.

Thanks in advance

Greg
 
Hi Greg,

Try:

'=============>>
Private Sub TextBox1_Exit(ByVal Cancel _
As MSForms.ReturnBoolean)
With Me.TextBox1
.Text = UCase(.Text)
End With
End Sub
'<<=============
 
Thanks Norman

Norman Jones said:
Hi Greg,

Try:

'=============>>
Private Sub TextBox1_Exit(ByVal Cancel _
As MSForms.ReturnBoolean)
With Me.TextBox1
.Text = UCase(.Text)
End With
End Sub
'<<=============
 
If you want the text to be uppercase as you are typing the text use this code
below.

Private Sub TextBox1_Change()
With Me.TextBox1
.Text = UCase(.Text)
End With
End Sub

It's nearly exactly the same except you have it opperate as soon as the
information within the textbox is changing.

Thanks to Norman for giving the starting point and code. :)

Rob
 

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

Back
Top