MrExcel Publishing
Your One Stop for Excel Tips & Solutions

capitilze all cells on a workshhet?

Posted by Matt on March 26, 2001 12:27 PM

Hello All,

Is there an easy way to capitilze all the cells on a worksheet?



Posted by mseyf on March 26, 2001 2:20 PM

here's one of my early attempts a writing a macro to do just what your asking. you need to select the area to convert to capitals.

Sub UpperCase()

Dim SelectedCells As Range
Dim ThisCell As Range

Application.Calculation = xlCalculationManual

If TypeName(Selection) <> "Range" Then Exit Sub 'make sure range is selected
Set SelectedCells = Selection

For Each ThisCell In SelectedCells 'cycle through & test cells
If Application.WorksheetFunction.IsText(ThisCell) Then
ThisCell = UCase(ThisCell)
End If


Application.Calculation = xlCalculationAutomatic

End Sub

I'm sure there's a better way to do it (but what that way is, I don't know).