Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Making a Cell's Contents Bold within a Macro.
by Allen Wyatt
(last updated August 16, 2016)
If you are writing macros using VBA, it is not uncommon to process data and place the results of your processing into cells in a worksheet. If desired, you can also make the results in a bold typeface so that they stand out. You do this by setting the Bold property of the Font object for a selection.
For instance, if you wanted to make the contents of cell A1 bold, you could use the following in your macro:
Cells(1, 1).Font.Bold = True
Likewise, if you wanted to make the currently selected cell bold, you could use the following code:
Selection.Font.Bold = True
If you wanted to explicitly turn off the bold attribute of a particular cell, all you need to do is change True to False in the foregoing examples.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8775) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Making a Cell's Contents Bold within a Macro.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
It's easy to automatically set the contents of one cell to be equal to another cell. But what if you want to copy the ...Discover More
When you display a time in a cell, Excel normally displays just the hours, minutes, and seconds. If you want to display ...Discover More
How Excel displays numbers is extremely flexible, but it can also be very confusing. This tip looks at how number display ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.