Why is the following code wrong?
Sub SetFont()
Dim a1 As Range
Set a1 = Range("a1")
SetFontSize (a1)
End Sub
Sub SetFontSize(target As Range)
target.Font.Size = 11
End Sub
I am getting “Run-time error 424: Object required” error when calling the SetFontSize method.
You’re not calling a function, you don’t need the parentheses when calling
SetFontSize (a1).Just use: