ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using cell color as criteria (https://www.excelbanter.com/excel-discussion-misc-queries/146637-using-cell-color-criteria.html)

Susan

Using cell color as criteria
 
Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.

Don Guillett

Using cell color as criteria
 
if range("a1").interior.ColorIndex=3 then msgbox "hi"

--
Don Guillett
SalesAid Software

"Susan" wrote in message
...
Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.



Earl Kiosterud

Using cell color as criteria
 
Susan,

Before you pursue this, check out Formatting as data (sorting on color, etc.) at
http://www.smokeylake.com/excel/excel_truths.htm.
--
Earl Kiosterud
www.smokeylake.com

Note: The norm in these groups is to top-post.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Susan" wrote in message
...
Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.




ShaneDevenshire

Using cell color as criteria
 
Hi Susan,

It looks like you are trying to do this with a spreadsheet function - you
can't, you need to use VBA.

You can either create a custom VBA FUNCTION depending on what you mean by
"do this" or a VBA subroutine, which is what Don is alluding to .
--
Thanks,
Shane Devenshire


"Susan" wrote:

Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.


Susan

Using cell color as criteria
 
Yeah, I didn't think I could do it with a simple spreadsheet function.

Thanks all for responses! I will look into the VBA solution.

"ShaneDevenshire" wrote:

Hi Susan,

It looks like you are trying to do this with a spreadsheet function - you
can't, you need to use VBA.

You can either create a custom VBA FUNCTION depending on what you mean by
"do this" or a VBA subroutine, which is what Don is alluding to .
--
Thanks,
Shane Devenshire


"Susan" wrote:

Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.


Bob Phillips

Using cell color as criteria
 
See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob

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

"Susan" wrote in message
...
Hi, I'd like to write a formula with IF function, using a cell color as a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.




Don Guillett

Using cell color as criteria
 
See my post

--
Don Guillett
SalesAid Software

"Susan" wrote in message
...
Yeah, I didn't think I could do it with a simple spreadsheet function.

Thanks all for responses! I will look into the VBA solution.

"ShaneDevenshire" wrote:

Hi Susan,

It looks like you are trying to do this with a spreadsheet function - you
can't, you need to use VBA.

You can either create a custom VBA FUNCTION depending on what you mean by
"do this" or a VBA subroutine, which is what Don is alluding to .
--
Thanks,
Shane Devenshire


"Susan" wrote:

Hi, I'd like to write a formula with IF function, using a cell color as
a
criteria. Is this possible?

Like,
=IF([cell.fill.color]=red,[dothis],[dothat])

Thanks.




All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com