Upper / lower case

ctomblin

New Member
Joined
Apr 25, 2002
Messages
49
I know that =UPPER(range) will convert all text in the range to upper case, but I can only make it work when the formula is in another cell. Is it possible to convert lower case to upper, and leave it in its original cells. Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

SimonP

New Member
Joined
Sep 25, 2002
Messages
48
One way to do this is via a very short piece of VBA code. Copy & paste the following into a code module, then assign it to a new custom toolbar button.

Private Sub UpperCase()
Dim cell
If TypeName(Selection) <> "Range" Then Exit Sub
For Each cell In Selection
If cell.HasFormula = False Then cell.Value = UCase(cell.Value)
Next cell
End Sub

Then, when you want to convert a range to upper case, simply select the range and click the cutom toolbar button. You can of course replace the 'UCase' function with 'LCase' to convert to lower case or 'Worksheetfuntion.Proper' to convert to proper case.
 

Forum statistics

Threads
1,143,640
Messages
5,719,984
Members
422,256
Latest member
downeybm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top