Make Certain Character Bold In A Cell In Excel

In this post we will see how to make some characters in a cell Bold in Excel.

We would have made entire cell bold in excel but in this example we will see how we can extract some text from a string in a cell and make it bold, this could be a useful feature as it could be used to highlight certain text phrase or some numeric character in a cell by making them bold.

Below is the data which shows a value in cell A1 and we want to make certain character bold in this cell, cell A1 has value “Italic Bold Underlined” and we want to make “Bold” substring as Bold.

Excel showing substring that needs to be formatted as bold

Step 1

Open VB editor from Developer tab in excel as shown in the figure.

Open developer tab to write VBA to make substring bold in a cell

Step 2

Insert a module in which we will write a VBA code to make certain characters bold in a cell.

Insert a module in the VB editor

Step 3

Now double click the newly created module to open that and paste the below code in the module.

Sub Make_Bold()

Range(“A1”).Characters(8, 4).Font.Bold = True

End Sub

VBA code to make a substring bold inside a cell value

This vba code is using Characters function which is telling VBA to start applying bold formatting to 4 characters from 8th character since “Bold” is having length of 4 and it starts from 8th position in the cell A1.

Now run the code by pressing F5 or by pressing play button the editor.

Below is the result that we get after running the code, as you can see in the result “Bold” string has become bold in formatting.

Result showing some characters are converted to bold

Hope this helped.

Share The Knowledge

Random Posts