Option Explicit
'Chuyen thanh chu hoa
Public Sub UCase_VBA()
Dim rngData As Range
Set rngData = Selection
Dim i As Long, j As Long
For i = 1 To rngData.Rows.Count
For j = 1 To rngData.Columns.Count
If Not rngData.Cells(i, j).HasFormula Then rngData.Cells(i, j) = UCase(rngData.Cells(i, j))
Next j
Next i
End Sub
'Chuyen thanh chu thuong
Public Sub LCase_VBA()
Dim rngData As Range
Set rngData = Selection
Dim i As Long, j As Long
For i = 1 To rngData.Rows.Count
For j = 1 To rngData.Columns.Count
If Not rngData.Cells(i, j).HasFormula Then rngData.Cells(i, j) = LCase(rngData.Cells(i, j))
Next j
Next i
End Sub