Pages

Saturday, July 3, 2010

VBA Code for Lowercase

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




Sub lower_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, vbLowerCase)
    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

2 comments:

  1. Hi, Ashish Ji
    I made a user form with 3 option button Upper,Lower & Proper case but unable to set the macro for each cases. Please guide me.

    ReplyDelete
  2. @suman can you share the workbook

    ReplyDelete