Filtering by color

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

bucci35

Active Member
Joined
Jul 6, 2002
Messages
319
what do I do with this udf? looks like some kind of vba code or something. I'm not too advanced in this stuff.

thanks,
 

bucci35

Active Member
Joined
Jul 6, 2002
Messages
319

ADVERTISEMENT

This works great, but now that I installed this how can I incorporate this to work inside of a macro?
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Hi bucci35

You can't, but that wasn't your question. Refer you back to Richard's post.

DominicB
 

bucci35

Active Member
Joined
Jul 6, 2002
Messages
319

ADVERTISEMENT

Ok,
can I filter by border? or by bold font?
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Hi bucci35

Enter this code into a blank module within your project (Alt+F11, Insert > Module) :

Code:
Function CellColour(UsrRng As Range) As Integer
Application.Volatile True
CellColour = UsrRng(1, 1).Interior.ColorIndex
End Function

Lets say the range you want to filter is A1:E100, and the coloured cells are in column A. In cell F1 put the formula : =CellColour(A1) and copy it down.

This will return the ColorIndex value of each cell in column A. You can now record your macro, but filter by column F (not A), but the end result will have the same efect as if you'd filtered by colour in column A.

Next time you post remember to be more explicit about what you want - you'll get an answer quicker, and better tailored to what you want.

HTH

DominicB
 

Forum statistics

Threads
1,136,354
Messages
5,675,299
Members
419,560
Latest member
g3org

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
Top