VBA Bold
Written by
Reviewed by
You can use VBA in order to make text in cells bold. In this tutorial, you will learn how to make text bold.
Bold Text With VBA
You would set the Font.Bold Property of the Font Object to True in order to make text in a cell bold. The following code will make the text in cell A1 bold:
Range("A1").Font.Bold = True
The result is:
The above example used the Range Object in conjunction with the Font Object. You can also use the Cell Object in conjunction with the Font Object in order to refer to the cell of interest. The following code will make the text in Cell C2 bold:
Cells(2, 3).Font.Bold = True
Clearing Bold With VBA
You would set the Font.Bold Property of the Font Object to False in order to make bold text in a cell the normal font weight. The following code will make bold text in cell A1, the normal font weight:
Range("a1").Font.Bold = False
Remove All Formatting With VBA
You can also remove all formatting from a single cell or cells in your worksheet including the bold font weight, using the .ClearFormats method. The following code will remove all formatting from all the cells in a worksheet and as a result, bold text will be changed into the normal font weight:
Cells.Select
Selection.ClearFormats
VBA Coding Made Easy
Stop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!Learn More!