Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!



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

By ands72082 ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

VBA Code

by p.j.hutchison In reply to How reference the format ...

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

Related Discussions

Related Forums