ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Upper case in textbox (https://www.excelbanter.com/excel-programming/364649-upper-case-textbox.html)

Greg[_27_]

Upper case in textbox
 
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



Norman Jones

Upper case in textbox
 
Hi Greg,

Try:

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


---
Regards,
Norman


"Greg" wrote in message
...
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




Greg[_27_]

Upper case in textbox
 
Thanks Norman

"Norman Jones" wrote in message
...
Hi Greg,

Try:

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


---
Regards,
Norman


"Greg" wrote in message
...
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






Rob

Upper case in textbox
 
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
"Greg" wrote:

Thanks Norman

"Norman Jones" wrote in message
...
Hi Greg,

Try:

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


---
Regards,
Norman


"Greg" wrote in message
...
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








All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com