Is there a way to get Excel's conditional formatting to do this? I want one cell to format one color (say yellow) only if another cell is colored yellow. So the conditional formatting would be something like if cell color(fill, etc) = yellow then format to yellow. hope that is easy enough to understand my question. thanks.
garbo74412009-10-24T21:05:51Z
Favorite Answer
You cannot conditionally format based on another cell's interior color in Excel. However, it can be done with a macro.
This macro will monitor A1 and if the interior color changes to yellow, B1 will also display yellow.
Change cell references to suit.
Copy the macro to the clipboard.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("A1").Interior.ColorIndex = 6 Then Range("B1").Interior.ColorIndex = 6 Else Range("B1").Interior.ColorIndex = xlNone End If End Sub
Select the appropriate worksheet and right click the sheet tab.
Select 'View Code'.
Paste the macro into the module editing area to the right.
Close back to Excel.
Change your base cell to yellow and the second cell will also change. Clear the interior color in the base cell and the second cell will also be cleared.