Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default VBA: How do I use IF formula with colours

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default VBA: How do I use IF formula with colours

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

-or-

If Cells(1, 1).Font.ColorIndex = 1 Then


"Helen" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I use IF formula with colours

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


"Helen" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I use IF formula with colours

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


"Rick Rothstein (MVP - VB)" wrote in
message ...
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


"Helen" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How do I use IF formula with colours

See http://www.xldynamic.com/source/xld.CFConditions.html but it is not
simple.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Helen" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I customise colours used in charts and keep those colours. LJ Charts and Charting in Excel 3 May 20th 10 01:50 PM
How to save one of the MORE COLOURS in the THEME COLOURS? Wulfy Excel Discussion (Misc queries) 0 August 18th 09 10:25 AM
Can I change the colours on a spreadsheet with an if formula? Changing Cell Colours with an If formula Excel Programming 1 December 8th 06 04:16 AM
How to use Add Ins / Formula Colours ianonline Excel Discussion (Misc queries) 0 May 9th 06 09:48 PM
Excel 2003 font colours and cell colours bretta Excel Discussion (Misc queries) 1 April 17th 05 03:45 AM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"