Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Excel conditional formatting - cell color?
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.
3 Answers
- garbo7441Lv 71 decade agoFavorite 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.
- Anonymous5 years ago
Put thia as the conditional format formula for A2 Formula is =B2="P"