Saturday, September 1, 2007

Upper Case


To change text in a selected range to upper case use this code.

Sub UpperCase()
Dim cell As Range
For Each cell In Selection.Cells
If cell.HasFormula = False Then
cell = UCase(cell)
End If
Next
End Sub

1 comment:

  1. formula

    =upper(a1)

    also
    =lower(a1)

    however:

    Sub ProperCase()
    Dim cell As Range
    For Each cell In Selection.Cells
    If cell.HasFormula = False Then
    cell = strconv(cell.text,vbProperCase)
    End If
    Next
    End Sub

    ReplyDelete