Wednesday, June 18, 2008

VBA Code to convert small letters to upper case in Excel

Sub ConvertCase()
Dim Rng As Range
For Each Rng In Selection.Cells
    If Rng.HasFormula = False Then
'Use this line for UpperCase text; change UCase to LCase for LowerCase text.
        Rng.Value = UCase(Rng.Value)
    End If
Next Rng
End Sub

No comments: