VBA & Macro Problems

How to Find and Select Bold Cells in an Excel Column using VBA

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 868 views

Question details

The user needs to locate and select every cell within a specific Excel column that has bold text formatting applied.

How to Find and Select Bold Cells in an Excel Column
Product
Spreadsheet
Device & OS
not provided
Scenario
Filtering or highlighting a dataset based on manual text formatting, specifically bold fonts, to perform bulk actions on those specific cells.
Observed behavior
Excel's native Find and Replace function lacks a direct method to filter search results exclusively by bold formatting, requiring a programmatic workaround to group the cells together.
Before you start

Ensure you are using the desktop version of Excel or WPS Office, as VBA macros are not supported in web-based versions. It is also recommended to back up your spreadsheet before running any new macro code.

Solution 1Recommended

Use a VBA Macro to Select All Bold Cells

Create a custom VBA script that loops through your target column, identifies cells with the bold font property, and selects them all at once using the Union function.

Since the standard Find tool doesn't natively search for font weights, a VBA macro is the most effective way to automate this. The macro scans a defined range (like A1 to A100), checks the 'Font.Bold' property of each cell, and groups the matching cells into a single selection so you can format, copy, or delete them in bulk.

1
Open the VBA Editor

Open your workbook and press the 'Alt + F11' keys simultaneously on your keyboard to launch the Microsoft Visual Basic for Applications (VBA) editor.

2
Insert a New Module

In the top menu bar of the VBA editor, click on 'Insert' and select 'Module' from the dropdown. This will open a new blank code window.

3
Paste the Macro Code

Copy and paste the following code into the module window: Sub SelectBoldCells() Dim rng As Range Dim cell As Range Dim boldCells As Range Set rng = Range("A1:A100") For Each cell In rng If cell.Font.Bold Then If boldCells Is Nothing Then Set boldCells = cell Else Set boldCells = Union(boldCells, cell) End If End If Next cell If Not boldCells Is Nothing Then boldCells.Select Else MsgBox "No bold cells found in the specified range." End If End Sub

4
Run the Macro

Press 'Alt + Q' to close the VBA editor and return to your spreadsheet. Then, press 'Alt + F8' to open the Macro dialog box, select 'SelectBoldCells' from the list, and click 'Run'.

Use a VBA Macro to Select All Bold Cells
Adjusting the Scan Range: By default, the code scans cells A1 through A100. You must modify the line `Set rng = Range("A1:A100")` in the code to match the actual column or data range you want to search (e.g., `Range("B1:B500")`).
Advanced VBA Support

Run VBA Macros Seamlessly with WPS Spreadsheet

WPS Office provides robust developer tools that fully support Excel VBA macros, allowing you to run scripts for formatting and data extraction natively within the application.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your .xlsm or .xlsx workbook containing your dataset.
  2. 2. Access the Developer Tools: Navigate to the 'Developer' tab on the top ribbon and click on 'VBA Editor', or simply press Alt+F11.
  3. 3. Execute the Code: Paste the bold-cell selection macro into a new module and run it exactly as you would in Microsoft Excel.
Fully compatible with Microsoft Excel VBA macros and .xlsm file formats.Familiar VBA Editor interface requiring no new learning curve.High-performance macro execution for scanning large columns.Comprehensive spreadsheet functionality within a lightweight application.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use Conditional Formatting to find and select bold cells instead of VBA?

No. Conditional Formatting is designed to apply styles (like bold text) based on cell values or formulas. It cannot natively detect or filter cells that have already been manually formatted as bold. VBA is required to read the existing manual font properties.

Why isn't my VBA macro working in Excel Online?

VBA macros are only supported in the desktop versions of Excel and WPS Office. Web-based spreadsheet versions do not have a VBA engine and instead rely on Office Scripts, which means standard VBA code will not execute in the browser.

How do I modify the VBA code to search for italic or underlined cells?

You can easily adapt the script by changing the property checked in the IF statement. To find italicized text, change 'cell.Font.Bold' to 'cell.Font.Italic'. To find underlined text, change it to 'cell.Font.Underline'.