TÔI MUỐN ĐỔI TẤT CẢ THÀNH CHỮ HOA

40. Tôi muốn đổi tất cả thành chữ hoa ?

Để đổi tất cả thành chữ hoa bạn cắt dán theo nội dung dưới đây

Mã:

Sub MakeUpper()

Dim MyText As String

Dim MyRange As Range

Dim CellCount As Integer

Set MyRange = ActiveSheet.Range(ActiveWindow.Selection.Address)

For CellCount = 1 To MyRange.Cells.Count

If Not MyRange.Cells(CellCount).HasFormula Then

MyText = MyRange.Cells(CellCount).Value

MyRange.Cells(CellCount).Value = UCase(MyText)

End If

Next CellCount

End Sub