Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. 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 January 18, 2020)
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, 2013, 2016, 2019, and Excel in Office 365. 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!
Excel allows you to perform math using times as operands. If you subtract a later time from an earlier time, you should ...Discover More
Need to use a date as part of a larger string of text? Here are some handy ways to go about the process.Discover More
If you need to easily change the font colors in a group of cells, one of the esoteric commands Excel provides is the ...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.