Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default UpCase in userform

Good Morning NG,
I have a text box that I receive user input for states.
I have the MaxLenght set to 2 so only things Like CA, NV, AZ can entered,
but sometimes the user wants to put in ca, nv, or az.
How can I set the text box to automatically capitalize the letters for the
users in VBA code
Thanks

Karen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default UpCase in userform

Michael,
You know, I tried that and it didn't work, so when I saw your post I thought
OK I'll try it again and see if I made a mistake and it didn't work, I got
an error message saying that I need to define user variables. BUT, I thought
this can't be so I tried it once more, making it a third time, and now it
works !!!
Anyway thanks
Today's not going to be a bummer after all.
Kames



"Michael Loganov" wrote in message
...
Karen,

To get the text as upper case you could try adding this code to the change
event.

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

TextBox1 has to be substituted with the name of your textbox.

Regards
Michael.


"Karen Agostinho" wrote in message
...
Good Morning NG,
I have a text box that I receive user input for states.
I have the MaxLenght set to 2 so only things Like CA, NV, AZ can

entered,
but sometimes the user wants to put in ca, nv, or az.
How can I set the text box to automatically capitalize the letters for

the
users in VBA code
Thanks

Karen






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default UpCase in userform

Hi,



Use the following code:



Private Sub TextBox1_Change()

TextBox1.Text = UCase(TextBox1.Text)

End Sub




--
JP

http://www.solutionsvba.com


"Karen Agostinho" wrote in message
...
Good Morning NG,
I have a text box that I receive user input for states.
I have the MaxLenght set to 2 so only things Like CA, NV, AZ can entered,
but sometimes the user wants to put in ca, nv, or az.
How can I set the text box to automatically capitalize the letters for the
users in VBA code
Thanks

Karen




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 bgkgmg Excel Worksheet Functions 1 February 26th 09 04:25 PM
UserForm FSt1 Excel Worksheet Functions 0 February 26th 09 02:00 AM
UserForm grahammal Excel Discussion (Misc queries) 15 April 10th 06 06:01 PM
Userform Jeff Excel Discussion (Misc queries) 0 February 6th 06 09:30 PM
Userform John Wilson Excel Programming 2 August 1st 03 06:33 PM


All times are GMT +1. The time now is 11:48 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"