Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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 All Occurrences Bold.

Making All Occurrences Bold

Written by Allen Wyatt (last updated June 18, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Tom rightly notes that in Word you can use Find and Replace to make all occurrences of a word bold. (Search for the word, replace it with the same word with bold formatting turned on.) He wonders how he can do the same thing in Excel.

Making such changes in Excel is actually quite easy and is done virtually the same way as you do in Word. Follow these steps:

  1. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box.
  2. Click the Options button to expand the dialog box. (See Figure 1.)
  3. Figure 1. The expanded Replace tab of the Find and Replace dialog box.

  4. In the Find What box, enter the word you want to make bold.
  5. Enter the same word in the Replace With box.
  6. Click the Format button to the right of the Replace With box. Excel displays the Replace Format dialog box.
  7. Click the Font tab. (See Figure 2.)
  8. Figure 2. The Font tab of the Replace Format dialog box.

  9. In the Font Style list, choose Bold.
  10. Click OK to close the Replace Font dialog box.
  11. Click Replace All to perform the replacements.

While this appears quite easy, you need to remember that these steps change the formatting of entire cells, not just words within a cell. Thus, if you were searching and replacing the word "brown," then any cell that contained the word "brown" would be made bold—the entire cell, not just the word.

If you want to only affect words within the cell, then these steps won't work. Instead you'll need to resort to a macro to do the bolding. Basically, you'll need a macro that looks through a worksheet and determines what can be changed. (You cannot make individual words or digits in formulas or numeric values bold; you can only make changes to the word-level formatting for text constants.)

Once the macro finds cells it can process, it needs to search through the cells for the desired word, and then make that text bold. The following macro implements this very strategy:

Sub FindAndBold()
    Dim sFind As String
    Dim rCell As Range
    Dim rng As Range
    Dim lCount As Long
    Dim iLen As Integer
    Dim iFind As Integer
    Dim iStart As Integer

    On Error Resume Next
    Set rng = ActiveSheet.UsedRange. _
      SpecialCells(xlCellTypeConstants, xlTextValues)
    On Error GoTo ErrHandler
    If rng Is Nothing Then
        MsgBox "There are no cells with text"
        GoTo ExitHandler
    End If

    sFind = InputBox( _
      Prompt:="What do you want to BOLD?", _
      Title:="Text to Bold")
    If sFind = "" Then
        MsgBox "No text was listed"
        GoTo ExitHandler
    End If

    iLen = Len(sFind)
    lCount = 0

    For Each rCell In rng
        With rCell
            iFind = InStr(.Value, sFind)
            Do While iFind > 0
                .Characters(iFind, iLen).Font.Bold = True
                lCount = lCount + 1
                iStart = iFind + iLen
                iFind = InStr(iStart, .Value, sFind)
            Loop
        End With
    Next

    If lCount = 0 Then
        MsgBox "There were no occurrences of" & _
          vbCrLf & "' " & sFind & " '" & _
          vbCrLf & "to bold."
    ElseIf lCount = 1 Then
        MsgBox "One occurrence of" & _
          vbCrLf & "' " & sFind & " '" & _
          vbCrLf & "was made bold."
    Else
        MsgBox lCount & " occurrences of" & _
          vbCrLf & "' " & sFind & " '" & _
          vbCrLf & "were made bold."
    End If

ExitHandler:
    Set rCell = Nothing
    Set rng = Nothing
    Exit Sub

ErrHandler:
    MsgBox Err.Description
    Resume ExitHandler
End Sub

The macro first sets the search range to those cells that contain text constants. It then prompts the user for a word that needs to be changed. Once entered, the macro then starts looking through all the cells in the range. Each cell is checked to see if it contains the target word. If so, then the .Bold property for those characters is set and the macro continues searching.

The macro also keeps track of how many changes were made, displaying the total changes at the end of its work.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12105) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Making All Occurrences Bold.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Calculating the Distance between Points

Want to figure out how far it is between two points on the globe? If you know the points by latitude and longitude, you ...

Discover More

Easily Changing Print Order

You can change the order in which pages are printed (normal or reversed) using the Print dialog box or the print settings ...

Discover More

Adding Area Codes to Phone Numbers

If you keep phone numbers in an Excel worksheet, you may need a way to add an area code to the beginning of all of the ...

Discover More

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!

More ExcelTips (ribbon)

Replacing in Worksheets and Comments At the Same Time

If you need to replace information that may appear in cells, comments, and text boxes, your best bet is to use a macro. ...

Discover More

Limiting Searching to a Column

When you use Find and Replace, Excel normally looks through all the cells in a worksheet. You may want to limit the ...

Discover More

Finding and Replacing in Text Boxes

Finding and replacing information in a worksheet is easy. Finding and replacing in other objects (such as text boxes or ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.