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

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


  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.


Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...