View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Doug Snow Doug Snow is offline
external usenet poster
 
Posts: 2
Default Checking Cell Background Color

I am trying to write a nested If statement based on the background
color in a cell...

Some cells (not all) have either a Light Yellow or Red background on
the worksheet that I will begin to maintain. If the background color
is x, I want this option button set, if the background color is y,
this option button gets set.

Set PNList = .Cells.Find(what:=FindPN, LookIn:=xlValues,
lookat:=xlWhole, searchorder:=xlByRows)

This is after it searches from a set pnlist = .cells.find instruction
(where PNList is a range).

If .Cells(PNList.Row, 1).Font.ColorIndex = 3 Then
ckbRedText.Value = True
ElseIf .Cells(PNList.Row, 1).Interior.ColorIndex = 19 Then
optCURR.Value = True
ElseIf .Cells(PNList.Row, 1).Interior.ColorIndex = 3 Then
optOLD.Value = True

End If

The .Cells(PNList.Row, 1).Font.ColorIndex = 3 command works just fine;
just cant figure it out when its the cell background color I am
looking at...