cell backcolor

  • Thread starter Thread starter Dave
  • Start date Start date
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
 
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)
 
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)
 
Back
Top