#1   Report Post  
Posted to microsoft.public.excel.misc
Jimbo1
 
Posts: n/a
Default TextBox


Hi,
On a Userform, does anyone know if you can set a textbox up so that
when characters are entered they are automatically changed to upper
case?

Cheers Jim.


--
Jimbo1
------------------------------------------------------------------------
Jimbo1's Profile: http://www.excelforum.com/member.php...o&userid=30637
View this thread: http://www.excelforum.com/showthread...hreadid=534502

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default TextBox

One way is to check after each character is typed:

Option Explicit
Dim BlkProc As Boolean
Private Sub TextBox1_Change()
If BlkProc = True Then Exit Sub
BlkProc = True
Me.TextBox1.Value = UCase(Me.TextBox1.Value)
BlkProc = False
End Sub

Another way is to just let the user type what they want and make it uppercase
when they leave the textbox.

Option Explicit
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox1.Value = UCase(Me.TextBox1.Value)
End Sub

And you could just make it uppercase when your code needs it and let the textbox
display what the user typed.

Option Explicit
Private Sub CommandButton1_Click()
MsgBox UCase(Me.TextBox1.Value)
End Sub

Jimbo1 wrote:

Hi,
On a Userform, does anyone know if you can set a textbox up so that
when characters are entered they are automatically changed to upper
case?

Cheers Jim.

--
Jimbo1
------------------------------------------------------------------------
Jimbo1's Profile: http://www.excelforum.com/member.php...o&userid=30637
View this thread: http://www.excelforum.com/showthread...hreadid=534502


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jimbo1
 
Posts: n/a
Default TextBox


Ive Found that this works Well

Private Sub Textbox1_Change()
TextBox1.Text = UCase(TextBox1.Text)
End Sub

Cheers


--
Jimbo1
------------------------------------------------------------------------
Jimbo1's Profile: http://www.excelforum.com/member.php...o&userid=30637
View this thread: http://www.excelforum.com/showthread...hreadid=534502

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox moves position when Printing? Rugdoody Excel Discussion (Misc queries) 1 September 21st 05 09:42 PM
Legnth of text in textbox control rgarber50 Excel Discussion (Misc queries) 3 July 15th 05 02:18 PM
textbox scrollbar disappears Yaniv Excel Discussion (Misc queries) 1 June 20th 05 11:31 PM
Rich Textbox M.Siler Excel Discussion (Misc queries) 8 May 5th 05 07:25 PM
manipulating textbox in chart Peter Hafner Charts and Charting in Excel 0 January 31st 05 10:55 AM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"