Question Locked

How reference the format (color) of cell in Excel formula

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need a formula like this but cannot find a way to reference the color of the cell used for the logic.

IF CELL COLOR = Yellow, then "yes", else "no"...

I searched under cell format constants and color constants but cannot seem to find what I need.
TIA
D

2 replies

by p.j.hutchison

Try some VBA. Here's an example of copying colors and values from one column to another and display colour values:

Sub Colours()
Dim bc As Variant, fc

For a = 1 To 6
bc = Cells(a, 1).Interior.ColorIndex
fc = Cells(a, 1).Font.ColorIndex
Cells(a, 2).Value = Cells(a, 1).Value
Cells(a, 2).Interior.ColorIndex = bc
Cells(a, 2).Font.ColorIndex = fc
Cells(a, 3).Value = bc
Cells(a, 4).Value = fc
Next a

End Sub

This discussion is closed to new replies.