Table of Contents
In this article we will learn how to filter cells having bold font formatting in excel using a simple VBA code
Steps to insert code
- Open the Visual Basic Editor using Alt + F11
- Goto Insert Tab
- Click on Module
- Paste the below code into module
Code
Function isBold(data As range)
isBold = data.Font.Bold
End Function
Using the function
- Create a New Column “CheckifBold”
- Type the function created : =isBold(Cell)
- The output of the above will be TRUE, if the text is bold otherwise it will show FALSE
- Copy paste the above formula till the end of the table.
- To see all the rows where the fond is Bold, select filter equals TRUE
- To see all the rows where the fond is not Bold, select filter equals FALSE
This is how we can filter cells having bold font in excel using VBA / macros code.
Import Code into your file
You can directly import the above code into your Excel file by following the below steps:
- Download the code file from here
- Open the Visual Basic Editor using Alt + F11
- Goto File Menu
- Click on Import File
- Browse to the folder path where the downloaded file is saved
- Click on Open
- The code is now available in your file.
Any Excel workbook in which macros are written should be saved in .xlsm (Excel Macro-Enabled workbook)format.