You can apply the bold font style to format the data or contents in cells in Excel, but do you know how to filter cells by the cells which containing bold font style in Excel? This article collects several tricky VBA macros to filter cells by bold characters in Excel.
Supposing you need to filter all bold cells in column B as below screenshot shown, please do as follows:
The below user-defined function helps to identify whether a cell in a column is bold or not, and then return the results as TRUE or False in a helper column. You can filter all TRUE results to display only the bold cells in column B.
1. Press the Alt + F11 keys to open the Microsoft Visual Basic for Application window.
2. In the Microsoft Visual Basic for Application window, click Insert > Module, then copy the following VBA code into the Module window. See screenshot:
VBA code: Filter cells by bold characters
Function IsBold(rCell As Range)
IsBold = rCell.Font.Bold
3. Press the Alt + Q keys to close the code window.
4. Select a blank cell which is adjacent to the table (the selected cell should locate on the same row of the first row in the filter table), copy the below formula into it and press the enter key.
5. Keep selecting the first result cell, and drag the Fill Handle to get all results. See screenshot:
6. Select the header of the helper column, click Data > Filter. Click the arrow button besides the header cell, check the TRUE box only, and then click OK.
Now all bold cells in column B are filtered out as below screenshot shown.
Quickly filter bold cells in a column with several clicks in Excel:
The below VBA code allows you to filter all bold cells in one column directly. Please do as follows.
1. Select the column range you will filter out all bold cells except the header cell. In this case, I select B2:B16.
2. Press the Alt + F11 keys to open the Microsoft Visual Basic for Application window.
3. In the Microsoft Visual Basic for Application window, click Insert > Module, then copy and paste the following VBA code into the Module window.
VBA code: Filter bold cells in a column
'Updated by Extendoffice 20191018
Dim cell As Range
For Each cell In Selection
If cell.Font.Bold = False Then
cell.EntireRow.Hidden = True
4. Press the F5 key to run this macro. Then all bold cells are filtered out in selected column range immediately.
Easily filter bold cells with an amazing tool
In this section, we are recommend you a handy tool – the Filter Bold cells utility of Kutools for Excel. With this utility, all bold cells in selected column are filtered immediately with several clicks.
1. Select the column range you will filter the bold cells, click Kutools Plus> Special Filter > Filter Bold to get it done. See below demo:
If you want to have a free trial ( 30-day) of this utility, please click to download it, and then go to apply the operation according above steps.
Filter multiple columns simultaneously in Excel After filtering one column with the Filter feature, only AND criteria can be applied to more than one column. In this case, how could you apply both the AND and OR criteria to filter multiple columns simultaneously in Excel worksheet? Methods in this article can do you a favor.
Filter or select cells by cell color in Excel Normally you can fill cells with different colors for any purposes in Excel. If you have a worksheet with using different colors to indicate different type of contents and you want to filter or select those cells by the cell color, you may get it done with the methods in this article.
Paste skipping hidden/filtered cells and rows in Excel For example, you have filtered a table in Excel, but now you need to copy a range and paste into this filtered table, do you know how to paste skipping the hidden/filtered cells and rows? Several easy ways in this article can help you.
Filter rows based on a list selection in another sheet In Excel, we usually filter rows based on a criteria, but if there are two list, one is in Sheet1, and another in Sheet2, could you have any tricks to quickly filter rows in Sheet1 based on the list in Sheet2? Here this article introduces the ways on solving this job.
Filter all related data from merged cells in Excel Supposing there is a column of merged cells in your data range, and now, you need to filter this column with merged cells to show all the rows which are related with each merged cell as following screenshots shown. In excel, the Filter feature allows you to filter only the first item which associated with the merged cells, in this article, we are talking about how to filter all related data from merged cells in Excel.
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.
Hi I am using this code and its working fine but whenever I click on cancel the dialogue box a popup window appear and shows some error. Can you please tell me how to remove that error.
:Sub FilterBold() Dim myRange As Range Set myRange = Application.InputBox(Prompt:="Please Select a Range", Title:="InputBox Method", Type:=8) myRange.Select Application.ScreenUpdating = False For Each myRange In Selection If myRange.Font.Bold = False Then myRange.EntireRow.Hidden = True End If Next myRange Application.ScreenUpdating = True End Sub
@cadafi ur formula works fine but it is not the optimised or efficient use of it. Rather we should use direct reference of the range or a cell in place of that complete offset command. Like the one as follows:
Copy down the formula and then use autofilter to filter the value TRUE. DONE