VBA to filter on Font Color (not default black)

MikeL

Active Member
Joined
Mar 17, 2002
Messages
488
Office Version
  1. 365
Platform
  1. Windows
Hello,
I would like to filter Col B for all cells which have a Font color not equal to the default black font.

Is there a VBA soluton?

Thanks in advance.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Is the font color set by the user manually, or is it set by Conditional Formatting (CF)? It matters which one.

If it is set by CF, you could put the CF formula in an empty column and filter on the True\False results.
 
Upvote 0
It is set by the user manually.

Thanks,
Mike
 
Upvote 0
This hides all rows where the column B font color is set to Automatic (tipically black). If the font color is spcifically set to black (not Automatic), change in the code xlAutomatic to 1.

Code:
[color=darkblue]Sub[/color] Hide_Black_Font_Rows()

    [color=darkblue]Dim[/color] cell [color=darkblue]As[/color] Range
    
    Application.ScreenUpdating = [color=darkblue]False[/color]
    [color=darkblue]For[/color] [color=darkblue]Each[/color] cell [color=darkblue]In[/color] Range("B1", Range("B" & Rows.Count).End(xlUp))
        cell.EntireRow.Hidden = cell.Font.ColorIndex = [COLOR="Red"]xlAutomatic[/COLOR]
    [color=darkblue]Next[/color] cell
    Application.ScreenUpdating = [color=darkblue]True[/color]
    
[color=darkblue]End[/color] [color=darkblue]Sub[/color]


[color=darkblue]Sub[/color] Show_All_Rows()
    Rows.Hidden = [color=darkblue]False[/color]
[color=darkblue]End[/color] Sub
 
Upvote 0

Forum statistics

Threads
1,203,677
Messages
6,056,688
Members
444,883
Latest member
garyarubin

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