cell backcolor

D

Dave

Hi,
I have a worksheet in Excel 97 with cells in column A
having either a white or yellow background color. I need
to filter based on this color. Can anyone please provide
info on how to return the value of backcolor for an
individual cell? I've tried the Cell("color",A2) formula
but it didn't work.
Thanks in advance
Dave
 
B

Bob Phillips

Dave,

You need a DUFF to get the colour code. Such as This

Function ColorIndex(rng As Range)
If rng.Count > 1 Then
ColorIndex = CvErr(xlErrValue)
Else
ColorIndex = rng.Interior.ColorIndex
End If
End Function

and in an adjacent column add the formula =ColorIndex(A1), copyu doen and
filter on that column number.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

I'm going to have to remove this darn spell-checker. What I wrote and meant
is UDF, which is a User Defined Function.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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