Uppercase?


Posted by Paul Magruder on May 13, 2001 1:04 PM

What is the code to convert lowercase to uppercase in a selected range?

Thanks in advance
Paul

Posted by Dave Hawley on May 13, 2001 1:55 PM


Hi Paul

If selection contains more than one cell then you could use:

Sub UpperCase()
Dim rCells As Range
For Each rCells In Selection
rCells = UCase(rCells.Text)
Next
End Sub


This would be fine for up to 500 to 1000 cells. Anymore than that and I would use a different approach eg run workheet formulas down a spare column via VBA.

Dave


OzGrid Business Applications



Posted by Paul Magruder on May 13, 2001 2:00 PM

Thanks Dave