VBA & Macro Problems

How to Split Bold and Non-Bold Text into Excel Columns

Huda QurayshiHuda Qurayshi Nov 4, 2026 869 views

Question details

The user needs a method to separate text located inside a single cell into different columns depending on whether specific characters are formatted as bold or non-bold.

How to Split Bold and Non-Bold Text into Excel Columns
Product
Excel
Device & OS
not provided
Scenario
Sorting or extracting mixed-format text data where bolding has been used to indicate a distinct data category, such as extracting names (bold) from addresses (non-bold) within the same cell.
Observed behavior
Excel's native Text-to-Columns feature and standard formulas cannot recognize character-level bold formatting, leaving users unable to split the text automatically.
Before you start

Ensure that the Developer tab is enabled in your Excel ribbon, as you will need to open the Visual Basic Editor to create a custom User-Defined Function (UDF) that reads character font properties.

Solution 1Recommended

Create a Custom VBA Macro to Extract Bold Text

Use VBA to create a custom function that loops through each character in a cell, inspects its Font.Bold property, and extracts the bold or non-bold text into distinct strings.

Since standard Excel formulas only read cell values and ignore formatting, you must use Visual Basic for Applications (VBA) to evaluate the formatting properties of individual characters within a cell string.

1
Enable the Developer Tab

Go to File > Options > Customize Ribbon. In the right pane, check the box for 'Developer' and click OK.

2
Open the VBA Editor

Navigate to the Developer tab and click 'Visual Basic', or press Alt + F11 on your keyboard to open the VBA Editor.

3
Insert a New Module

In the VBA Editor, right-click on your workbook name in the Project Explorer panel, select Insert, and then click 'Module'.

4
Add the VBA Code

Paste a VBA script that defines a new function (e.g., Function GetBoldText). The script should contain a loop that checks ActiveCell.Characters(i, 1).Font.Bold and appends the character to the result if true.

5
Apply the Function in Your Worksheet

Return to your Excel sheet. In an adjacent blank column, type your new custom function (e.g., =GetBoldText(A1)) and press Enter to extract the bold text.

6
Save as a Macro-Enabled Workbook

Go to File > Save As, and change the file type to 'Excel Macro-Enabled Workbook (*.xlsm)' so your VBA code is not lost when you close the file.

Create a Custom VBA Macro to Extract Bold Text
Recalculation Requirement: Custom VBA functions that rely on formatting do not recalculate automatically when you change a cell's bold status. You will need to press F9 or re-enter the formula to refresh the output.
Advanced Macros in WPS Spreadsheet

Run VBA Macros Seamlessly in WPS Office

WPS Spreadsheet fully supports VBA macros and custom user-defined functions, allowing you to easily run scripts to split text by bold formatting without needing a costly Microsoft Excel subscription.

  1. 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open your dataset containing the mixed-format text.
  2. 2. Access the VBA Editor: Navigate to the Developer tab on the ribbon and click on 'VBA Editor'.
  3. 3. Insert the extraction macro: Right-click in the Project window, select Insert > Module, and paste your bold-text extraction VBA code.
  4. 4. Extract the text: Return to your spreadsheet and type your custom formula (e.g., =ExtractBold(A1)) to perfectly split the bold and non-bold text into separate columns.
Fully compatible with Microsoft Excel .xlsm files and VBA macros.Lightweight architecture ensures fast performance even with complex macro calculations.Built-in Developer tools available for creating and editing scripts for free.Familiar spreadsheet interface that requires zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can I split bold text using standard Excel formulas instead of VBA?

No. Standard Excel functions like LEFT, RIGHT, MID, or the Text-to-Columns wizard only read the underlying plain text values. They cannot detect or interact with character-level formatting such as bold, italics, or font color. A custom VBA function is strictly required.

Why does my extracted bold text not update automatically when I change the formatting?

Excel's calculation engine is triggered by changes in cell values, not changes in cell formatting. If you make an existing word bold after applying the VBA formula, you must force Excel to recalculate by pressing F9 or double-clicking the cell with the formula and pressing Enter.

How do I save my workbook after adding the bold text extraction macro?

You must save the file as an Excel Macro-Enabled Workbook (.xlsm). If you attempt to save it as a standard Excel Workbook (.xlsx), Excel will display a warning and subsequently strip the VBA code from the file, breaking your custom formula.