Changing Lower Case to Upper Case


Posted by Randycas on June 25, 2001 6:44 AM

I have these worksheets that will be used by an overseas agent. At the end of each month these worksheets will be used to update all our files. What I want is to make sure that even if the user uses lower case it would be changed to upper case when they input the information.

Cas

Posted by Ron on June 25, 2001 6:53 AM

Not sure how the data is being input. But if it's input into a cell and that data is saved somewhere else use the UPPER function. For example if cell A1 contains "error". UPPER(A1) yields "ERROR".

Posted by Joe Was on June 25, 2001 7:19 AM

Right click on the "Sheet Tab" select "View code" copy and paste:

If you use code in the sheet tab module it must be named the name below. If you put it on a control or on the macro pages you can name it anything you want.

"The solution came from Bertie and works like a charm. In my actual application I changed the columns in the code above. So it should work with any column range. Thank's Bertie."

If you use thos code, do not change the macro name or the code will fail. You should change the Range or change the code to use the whole sheet. The key is:

x=UCase(x.Text)
where "x" is the range or sheet identifier.

Hope this helps. JSW

Posted by Randycas on June 25, 2001 12:59 PM

Thanks a lot Joe,I have used the code you sent and it worked, but i have a question. Is there any way i can get the text to change to upper case as soon as i deselect the cell? I find that i have to return to the cell for the text to change to capitals.

Cas

Posted by Joe Was on June 26, 2001 5:33 AM

One of the exit events,should do it but I am not certain which works in the sheet tab and I am on a task today so I can't test. Try looking up "OnEvent" "Event" "Lost Focus" in Excel Macro Help and in the BB also try the Ark's. If you can't find it re-post and I will play with it. JSW Thanks a lot Joe,I have used the code you sent and it worked, but i have a question. Is there any way i can get the text to change to upper case as soon as i deselect the cell? I find that i have to return to the cell for the text to change to capitals.

Posted by Randycas on June 26, 2001 1:01 PM

I have checked help and i have tried to apply some of what i found with no results. I will keep trying, should you come up with anything else i would be grateful.By the way - what is the Ark's in BB. I am a newborn when it comes to these things. Cas One of the exit events,should do it but I am not certain which works in the sheet tab and I am on a task today so I can't test. Try looking up "OnEvent" "Event" "Lost Focus" in Excel Macro Help and in the BB also try the Ark's. If you can't find it re-post and I will play with it. JSW : Thanks a lot Joe,I have used the code you sent and it worked, but i have a question. Is there any way i can get the text to change to upper case as soon as i deselect the cell? I find that i have to return to the cell for the text to change to capitals. :

Posted by Joe Was on June 27, 2001 3:32 PM

The sheet tab code will work for new data. If the cell has data in it already, then the code will only work if you click the cell and select another cell.

We can Bold a whole sheet with existing data but the UCase acts on the font itself not the font attributes so its not availible for the whole sheet.

I will play with some code and see if I can trick VB into an update? JSW

Posted by Joe Was on June 27, 2001 6:24 PM

BB= This Bulletin Board, Ark = The BB'S Archives of old Info.

At the top of this BB are hyperlinks to older messages. To search these you click the names Archive2 or Archive. Then to search for key words or phrases press Ctrl-f and add your subject and press "Find Next." I have seen a lot on case and you may also look for color (sheet code is used to change cell color) or other code to change the basic way Excel works. JSW The sheet tab code will work for new data. If the cell has data in it already, then the code will only work if you click the cell and select another cell. We can Bold a whole sheet with existing data but the UCase acts on the font itself not the font attributes so its not availible for the whole sheet. I will play with some code and see if I can trick VB into an update? JSW



Posted by Randycas on June 28, 2001 9:42 AM

Re - Uppercase - Error punching code - IT WORKS FINE

Hey, an error on my part.Instead of typing Worksheet_Change i had worksheet_SelectionChange, therefore i had to reselect the text. But i corrected the error and it works fine now.

Thanks for the help!!!!!!! At the top of this BB are hyperlinks to older messages. To search these you click the names Archive2 or Archive. Then to search for key words or phrases press Ctrl-f and add your subject and press "Find Next." I have seen a lot on case and you may also look for color (sheet code is used to change cell color) or other code to change the basic way Excel works. JSW : The sheet tab code will work for new data. If the cell has data in it already, then the code will only work if you click the cell and select another cell. : We can Bold a whole sheet with existing data but the UCase acts on the font itself not the font attributes so its not availible for the whole sheet. : I will play with some code and see if I can trick VB into an update? JSW :