Pages

Saturday, July 3, 2010

VBA Code for Uppercase

If you want to change case of selected cells in one go . Try this macro


Sub Upper_case()

Dim cell_1 As Range

For Each cell_1 In Selection.Cells
    If cell_1.HasFormula = False And Not IsEmpty(cell_1) And Not IsDate(cell_1) Then
        cell_1 = StrConv(cell_1.Text, vbUpperCase)
    End If
Next


End Sub



Steps to Use
  • Copy the below code
  • Press Alt+F11 to open VBA editor
  • Paste it in any public module or module 1
  • Select the cells & run the Macro

No comments:

Post a Comment