This post will guide you how to select only bold cells in a range of cells in Excel. How do I select all bold cells in a given range using VBA Macro in Microsoft Excel 2013/2016/2019/365.
Assuming that you have a list of data in range B1:C5, and you want to select all cells with bold font formatting in Excel. This post will show you two methods to select all bold cells.
Table of Contents
1. Select Only Bold Cells Using Find And Replace
If you want to select all cells with bold fond formatting, you can use Find and Replace feature to find the specific text or specific format in the worksheet, such as: cell color, bold font…etc. Just do the following steps to find and select all the bold formatting in the selected range of cells:
Step1: select the range in which contain bold cells that you want to find.
Step2: go to Home tab, click Find & Select command under Editing group. And click on Find from the Find and Select drop down list. The Find and Replace dialog will open.
Step3: click on the Options button in the Find and Replace dialog box.
Step4: click the Format button in the Find what section, and select Choose Format From Cell from the Format drop down list. And the Find Format dialog will open.
Step5: click Font tab in the Find Format dialog box, and select the Bold option in the Font Style list box, and click Ok button to go back to the Find and Replace dialog box.
Step6: click the Find All button, then all cells with the bold font formatting in the selected range of cells would be searched.
Step7: press Ctrl + C keys on your keyboard to select all results, then it will select all the cells that have the text with bold fond formatting.
2. Select Only Bold Cells Using VBA
You can also use an Excel VBA Macro to achieve the same result of selecting only bold cells in a given range of cell. Just do the following steps:
Step1: open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
Step2: then the “Visual Basic Editor” window will appear.
Step3: click “Insert” ->”Module” to create a new module.
Step4: paste the below VBA code into the code window. Then clicking “Save” button.
Sub SelectOnlyBoldCells()
Dim myRange As Range
Dim cell As Range
Dim tempRange As Range
Set myRange = Range("A1", "D3")
For Each cell In myRange
If cell.Font.Bold = True Then
If tempRange Is Nothing Then
Set tempRange = cell
Else
Set tempRange = Union(tempRange, cell)
End If
End If
Next cell
If Not tempRange Is Nothing Then
tempRange.Select
End If
End Sub
Note: This VBA code will use another range called tempRange, which receives the cell reference with the bold fond formatting. And the UNION function is used to concatenate the addresses together. After the procedure finished, the range tempRange is selected.
You need to change the value of myRange variable as you need.
Step5: back to the current worksheet, then run the above excel macro. Click Run button.
Step6: Let’s see the result:
3. Video: How to Select Only Bold Cells in Excel
In this video, you will learn how to select only bold cells in Excel using find and replace as well as VBA code.
Leave a Reply
You must be logged in to post a comment.