VBA: How do I use IF formula with colours

  • Thread starter Thread starter Helen
  • Start date Start date
H

Helen

I have a spreadsheet that is colour coded, and I want to be able to return a
yes or no based on whether the cell is coloured in or not.

I'm trying to use If Then with FormatConditions.Colorindex but it's not
working.

Many thanks

Helen
 
If Cells(1, 1).Interior.ColorIndex = 1 Then

-or-

If Cells(1, 1).Font.ColorIndex = 1 Then
 
Something like this maybe (change the cell reference and what you are
returning the Yes/No to to suit your needs)...

If Range("A1").Interior.ColorIndex < 0 Then
Answer = "No"
Else
Answer = "Yes"
End If

Rick
 
Read the link that Bob provided... that is probably more along the lines of
what you are after than what I assumed in my posting.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top