filtering

  • Thread starter Thread starter Lynn
  • Start date Start date
L

Lynn

hi,
i have highlighted serveral rows in my excel spreadsheet.
how can i filter it such that only highlighted rows are being displayed on
the screen?
thanks
 
How did you highlight the cells?

If you just changed the color, you could use a UDF in another cell to return the
value of the color in that cell.

Chip Pearson has a UserDefinedFunction at:
http://www.cpearson.com/excel/colors.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

==
If you used Format|conditional formatting to change the colors, then the easiest
thing would be to replicated that rules you used in another column of helper
cells. Then use that column as your filter.
 
copy the code from Chip's web page. It's the one that starts with:

Function CellColorIndex(InRange As Range, Optional _
OfText As Boolean = False) As Integer


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.
Into a test cell and type:
=Cellcolorindex(a1)
 
Back
Top