![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
I have a macro which colours the cells in two columns of a worksheet according to the text that the cell may contain. For example, if a cell contains "BSR" it will appear red, "APG" will appear blue, "PTR" will appear yellow, "KML" will appear green - and so on. All other cells remain white.
Here's the question ..... is there any way that I can now filter out all of the rows containing these coloured cells (and retain the row 1 column headings) - in much the same way an autofilter would work? Any ideas would be greatly appreciated - many thanks. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 175
|
can you not just filter by the text, if the text corresponds directly to a colour?
__________________
Regards, Mike. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Thanks for the suggestion, Mike ..... but the problem is there are as many as 10 different text entries that I would like to filter out simultaneously.
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 363
|
Add a new column with the following formula:
=IF(or(A1="A",A1="B",A1="C",....),"Y","N") where A,B,C... are the conditions you want to filter on. Then you can use auto filter on the column you've just added for "Y"
__________________
It's never too late to learn something new. Ricky |
|
|
|
|
|
#5 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Thanks for the help, Ricky. Have managed to resolve the problem by using an advanced filter first, then running the macro to colour the cells.
Thanks again. rollo |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|