filtering colours

  • Thread starter Thread starter p3project
  • Start date Start date
P

p3project

Guys

Can you tell me if it is possible to filter rows identified by colou
plz? If so, how do you do this??

Any help would be most welcome

Thanks

Dav
 
Not directly. You can create a user-defined function, use
this function to return the color index of the current
cell, and then filter by color index.

1. Press ALT+F11.
2. Go to Insert > Module.
3. Paste in the following code:

Function cellcolor(Target As Range)
cellcolor = Target.Interior.ColorIndex
End Function

4. Click back into XL.
5. In the next open column, put a header like "Color".
6. In the next cell of this column, call the function
like:
=cellcolor(D2)
7. Now copy this cell, select the rest of the column, and
do Edit > Paste Special > Formula
8. Now apply your AutoFilter and filter on this new col.

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top