Forum Discussion
Conditional Formatting based on cell color
Thanks, but this is not quite exactly what I was hoping for.
What I am looking for is:
When a cell's interior color changes, then the Conditional Formatting will change.
Example:
Cell A1 interior color is green Conditional Formatting font color becomes Black
Cell A1 interior color is blue Conditional Formatting font color becomes yellow
Cell A1 interior color is Purple Conditional Formatting font color becomes red.
Any time I change A1s interior color, the CF Font changes accordingly.
My research so far shows that there are no conditional formatting to check cell interior color, so I am thinking that a VBA code snipit is going to be the solution, but since I know there are many creative Excel experts here, I wanted to ask first just in case...
- NikolinoDEJan 25, 2023Platinum Contributor
this macro would be an approach, but without a value in a cell I don't think this can be done. Excel needs values or text to do anything, but I don't know of any way that can be automated with colors.
Option Explicit Sub Colour() Dim c As Range For Each c In Range("A1:D15, A1:D15") On Error Resume Next c.Font.ColorIndex = c.Interior.ColorIndex = 2 Next End SubThank you for your patience and understanding