#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB UserForm


If I want to change the case from lower case to upper case in the
following location I can use the following code.
Dim cell As Range
For Each cell In Range("F3").Cells
If cell.HasFormula = False Then cell = UCase(cell)
Next

How do I achieve the same result if the location is a TextBox created
in a UserForm. ie TextBox1 in UserForm1


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=507615

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default VB UserForm


Me.TextBox1.Text = UCase(Me.TextBox1.Text)

If code is not in the form change "Me" to the form name

Note this will trigger the TextBox Change event if you are using it. If
necessary set a (global) boolean flag to True/False either side of the above
code to early exit the event and re-set to false when done.

Private Sub TextBox1_Change()
If bExit Then Exit Sub
End Sub

Regards,
Peter T


"grahammal" wrote
in message ...

If I want to change the case from lower case to upper case in the
following location I can use the following code.
Dim cell As Range
For Each cell In Range("F3").Cells
If cell.HasFormula = False Then cell = UCase(cell)
Next

How do I achieve the same result if the location is a TextBox created
in a UserForm. ie TextBox1 in UserForm1


--
grahammal
------------------------------------------------------------------------
grahammal's Profile:

http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=507615



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
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


All times are GMT +1. The time now is 12:18 AM.

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

About Us

"It's about Microsoft Excel"