bepedicino
Board Regular
- Joined
- Sep 29, 2014
- Messages
- 73
Could someone please help me by providing VBA code that will make columns A,B,E,J in a specific sheet uppercase?
Sub MakeUpperCase()
Dim myCols As Variant
Dim i As Integer
Dim myLastRow As Long
Dim myRow As Long
' Specify columns to apply to
myCols = Array("A", "B", "E", "J")
Application.ScreenUpdating = False
' Loop through columns
For i = LBound(myCols) To UBound(myCols)
' Find last row of that column
myLastRow = Cells(Rows.Count, myCols(i)).End(xlUp).Row
' Loop through all rows in that column (down to last row with data)
For myRow = 1 To myLastRow
' Make entries upper case
Cells(myRow, myCols(i)) = UCase(Cells(myRow, myCols(i)))
Next myRow
Next i
Application.ScreenUpdating = True
End Sub