Excel Guides

Making a Cell's Contents Bold within a Macro in Excel

When creating a macro in Excel, you may want to make the contents of a cell bold. This can be done by using the Font property of the Range object. The following code will make the contents of cell A1 bold:

Range("A1").Font.Bold = True

If you want to make the contents of multiple cells bold, you can use the Union method of the Range object. The following code will make the contents of cells A1:A5 bold:

Range("A1:A5").Font.Bold = True

You can also use the Intersect method to make the contents of cells that intersect two ranges bold. For example, if you have a range named "MyRange" that consists of cells A1:A5 and another range named "OtherRange" that consists of cells B2:B6, you can use the following code to make the contents of the cells that intersect both ranges bold:

Intersect(MyRange, OtherRange).Font.Bold = True

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.