Sort / Print only Coloured rows of a table.

A

ajc

I am working with a table (Matrix) which has about 13 colums & 500
rows. I have used the conditional formatting formula which colours a
particular row of the table depending upon the value of a particular
cell of that row (Note: This value keeps changing depending upon the
data entered in other cells of the row). At a given time around 100
rows are coloured.
Is there any Formula / Macro by which I can sort the coloured
rows / Print only coloured rows.

Thanks,

ajc
 
F

Frank Kabel

Hi
I would use a helpe column which duplicates your conditional format
conditions (and shows for example 'X' if the condition is met). It's
quite difficult to get the conditional format results (e.g. the
colorindex property does NOT show the color of a conditional format).

For conditional hiding specific rows see:
http://www.rondebruin.nl/print.htm#Hide
 
M

mzehr

Hi,
One way to do this:
you will need a user defined function and the use of a
helper column

for the UDF (From John Walkenbach):
Function FILLCOLOR(cell) As Integer
' Returns an integer corresponding to
' cell's interior color
FILLCOLOR = cell.Range("A1").Interior.ColorIndex
End Function

In the helper column use the formula, assuming that your
data is in column A
=fillcolor(A1)
Then filter by your helper column

HTH
 
M

mzehr

Ignore my earlier post. Frank is correct in that this UDF
will not pick up the color if the cell is colored by
conditional formatting. It will only pick up the color
information if the cell is formatted directly with that
color.

Sorry for the miscue.
 

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

Top