Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change text to all caps
I need your help with code for changing the text within a cell to all
caps. I want to attach the code to the sub "worksheet change" event to enable the code. For example: If someone types a lower case value into a cell it will automatically change to uppercase. Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change text to all caps
See the response to your earlier thread.
John wrote: I need your help with code for changing the text within a cell to all caps. I want to attach the code to the sub "worksheet change" event to enable the code. For example: If someone types a lower case value into a cell it will automatically change to uppercase. Thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change text to all caps
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then Application.EnableEvents = False Target.Value = UCase(Target.Value) Application.EnableEvents = True End If End Sub -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change text to all caps
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then With Target .Value = UCase(.Value) End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "John" wrote in message om... I need your help with code for changing the text within a cell to all caps. I want to attach the code to the sub "worksheet change" event to enable the code. For example: If someone types a lower case value into a cell it will automatically change to uppercase. Thank you |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change text to all caps
The following will work for a single cell at a time
Private Sub Worksheet_Change(ByVal Target As Range) a = Target.AddressLocal Target.Value = UCase(Target.Value) End Sub -----Original Message----- I need your help with code for changing the text within a cell to all caps. I want to attach the code to the sub "worksheet change" event to enable the code. For example: If someone types a lower case value into a cell it will automatically change to uppercase. Thank you . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
In excel can you change words from all caps to initial caps? | Excel Discussion (Misc queries) | |||
How do I change text from all caps to normal type? | Excel Worksheet Functions | |||
How to change ALL CAPS to Initial Caps only? | Excel Worksheet Functions | |||
How to automatically change a single letter text entry to caps?? | New Users to Excel | |||
Change source text in Excel from all caps to upper and lower case. | Excel Discussion (Misc queries) |