How to filter cells by bold characters in Excel?

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.

Kutools for Excel: add 120 new features in Excel. Save one hour every day.
Classic Menu for Office: brings back classic menus to Office 2010 and 2013 (includes Office 365).
Office Tab: brings tabbed interface to Office as the use of web browser Chrome, Firefox and Internet Explorer.

For example, to filter cells according to the cells containing bold font style:


Hot
Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!

arrow blue right bubbleVBA Macro 1:

If you can identify whether the strings are bold or not, task goes easy to filer the cells by bold formatting. This VBA Macro is to identify the bod strings in cells.

Step 1: Hold down the Ctrl + F11 keys to open the Microsoft Visual Basic for Application window.

Step 2: Click the Insert >> Module, and paste the following VBA code on the new Module window:

Function IsBold(rCell As Range)
IsBold = rCell.Font.Bold
End Function

Step 3: In the Cell D2, enter the formula of =IsBold(B2), and press the Enter key. If the string in Cell B1 are bold, it returns True in Cell D2, otherwise False.

Step 4: Select the range of D2:D17, and Click the Home >> Fill >> Down to copy the formula to other cells in the range.

Step 5: Click the Filter button under Data tab.

Step 6: Click the arrow button besides the title of Column D.

Step 7: Uncheck the Select All item, and check the True item. See the following screen shot:

Now it filters the cells in column B which are bold, and hide others, see the following screen shot:


arrow blue right bubbleVBA Macro 2:

This VBA Macro allows you to filter the bold cells in one column directly.

Step 1: Select the range that you will filter by bold. In this case select the range of B2:B17.

Note: You cannot select the header cell at the top of filtered column, says Cell B1.

Step 2: Hold down the Ctrl + F11 keys to open the Microsoft Visual Basic for Application window.

Step 3: Click the Insert >> Module, and paste the following VBA code on the new Module window:

Sub FilterBold()
Dim cell As Range
For Each cell In Selection
If cell.Font.Bold = False Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub

Step 4: Press the F5 key to run this macro.

Now you will get the filter result same as the figure we showed you in VBA Macro 1.


arrow blue right bubbleVBA Macro 3:

This VBA macro also allows you to filter column by bold directly.

Step 1: Hold down the Ctrl + F11 keys to open the Microsoft Visual Basic for Application window.

Step 2: Click the Insert >> Module, and paste the following VBA code on the new Module window:

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

Step 3: Press the F5 key to run this macro.

Step 4: InputBox Method dialog box pops up, and please specify the filter range, says B1:B17 in this case, and click OK.

Now it hides all rows whose cells in Column B are not bold, and filter only the cells are bold. See the filtering result.


Kutools for Excel

More than 120 Advanced Functions for Excel 2013, 2010, 2007 and Office 365.

screen shot

btn read more     btn download     btn purchase

Comments  

0#cadafi2013-12-20 04:10
I presume that column A is the reference Column with Bold cells.
I create a Name "Bold?" with the refer to as below

=GET.CELL(20,OFFSET(INDIRECT("A1"),ROW()-1,0))

In column B, I type:
=Bold?

Copy down the formula and then use autofilter to filter the value TRUE. DONE
Reply | Reply with quote | Quote
0#Anjali2014-01-30 07:06
@Cadafi.... thats brilliant... wondering how it works though!
Reply | Reply with quote | Quote
0#Mohammad Faizan2014-02-13 07:05
@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:

=GET.CELL(20,'Sheet1'!A1)

Copy down the formula and then use autofilter to filter the value TRUE. DONE
Reply | Reply with quote | Quote
-1#cadafi2014-06-25 07:11
@Mohammad Faizan
You are entirely correct. Thanks.
Reply | Reply with quote | Quote
-1#cadafi2014-06-25 07:26
Thanks Mohamand Faizan. You are entirely correct.
Reply | Reply with quote | Quote
+1#Statistics Guru2014-06-24 14:38
This worked perfectly, thank you!!! :D:lol:
Reply | Reply with quote | Quote

Add comment


Security code
Refresh