Filter only bold text

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Not directly, you'd need to use a little bit of VBA.

Paste this code into a standard VBA module:-

Public Function Isbold(AnyCell As Range) As Boolean
If AnyCell.Font.Bold = True Then Isbold = True
End Function

Then use it like this:-
Book2
ABCD
1Field1Field2Field3Isbold
2249FALSE
3485FALSE
4875FALSE
5807FALSE
6343TRUE
7207FALSE
8215FALSE
9362FALSE
10032TRUE
11828FALSE
12982FALSE
13281TRUE
14976FALSE
15587FALSE
16976TRUE
17389FALSE
18701FALSE
19936FALSE
20781FALSE
Sheet1


You can filter bold text by filtering where Isbold is true or false.
 
Upvote 0
Just out of *safety*, I'd change a bit dk's function, like this:

<font face=Courier New>
<SPAN style="color:#00007F">Public</SPAN> <SPAN style="color:#00007F">Function</SPAN> Isbold(AnyCell <SPAN style="color:#00007F">As</SPAN> Range) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN>
    Isbold = AnyCell.Range("A1").Font.Bold
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN>

</FONT>
 
Upvote 0
Juan Pablo González said:
Just out of *safety*, I'd change a bit dk's function, like this:

<font face=Courier New>
<SPAN style="color:#00007F">Public</SPAN> <SPAN style="color:#00007F">Function</SPAN> Isbold(AnyCell <SPAN style="color:#00007F">As</SPAN> Range) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Boolean</SPAN>
    Isbold = AnyCell.Range("A1").Font.Bold
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN>

</FONT>

OK Juan, that's fair enough! I'm relying on the fact that a boolean function will return false unless explicitly set to true. Not being argumentative, but what is safer with what you proposed? :)

BTW, like the flags amendment...
 
Upvote 0
I am amaster in excel most of my dreams in excel came true but anything about vba's
I would apreciate if someone can teach me a little bit about it
I am a quick learner you'l be suprized what spreadsheets I made already without vba's.
You can have alot of fun
Thank You
 
Upvote 0
dk said:
...Not being argumentative, but what is safer with what you proposed? :) ...
:LOL: I should have used another word... what I was thinking is that if you pass something like

=isBold(A2:D2)

and the bold property is "mixed" in there, some true and some false, the

anyRange.Font.Bold

will return Null. Altough your function WOULD work.. because you're first comparing it with True... I just like making fast assignments...

And glad you like it ! I want to see how varied is our community...
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,431
Members
451,705
Latest member
Priti_190

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top