Question

Locked

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.
TIA
D

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| 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

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums