VBA MOD01 With and ...And With for easier coding
With and ...And With for easier coding
Public Sub With_Change_Font()
Dim myRange As Range
Set myRange = Range("A10", "A" & Cells(Rows.Count, 1).End(xlUp).Row)
'Debug.Print myRange.Address
With myRange.Font
.Name = "Arial"
.Bold = True
.Size = 14
End With
End Sub
Public Sub With_Reset_Font()
Dim myRange As Range
Set myRange = Range("A10", "A" & Cells(Rows.Count, 1).End(xlUp).Row)
'Debug.Print myRange.Address
With myRange.Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
End Sub
Comments
Post a Comment