Bold dynamic range syntax

GTretick

Member
Joined
Jul 29, 2015
Messages
42
Reaction score
0
Points
6
Location
Canada
Excel Version(s)
365
I'm looking to bold a dynamic range by using variables to set the range

To start with I can't get the syntax right so that VBA understands what I want.

The following line would bold from A1 to D4 (except it doesn't). I would swap out the various digits with variables so the range can change based upon various conditions.
I'm starting with hard coding the coordinates to break the problem down into an easier bite sized piece.


From what I can tell from Google, this should work but it doesn't do anything to my active sheet.
What do I need to change in the line to make it work?

Range(Cells(1, 1), Cells(4, 4)).Font.Bold = True

Thanks.
 
Works for me.
Code:
Sub Bold_Things()
    Range(Cells(1, 1), Cells(4, 4)).Font.Bold = True
End Sub
What else do you have in your macro?
 
I went and tried it as a stand-alone. It does in fact work.

You are right, it must be something else in my code. Now that I know the syntax is correct I can move on.

Thanks
 
Back
Top