Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 148
Default tell if a cell is shaded

I want to place the word "YES" in cell F2 if the cell A2 background is gray.
How do I do that Thanks

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,365
Default tell if a cell is shaded

You'd have to do this with some macro code. Excel simply was never created
to make decisions based on cell shading or border color or style or anything
like that; it makes decisions based on the value/content of cells.

Now, if A2 is formatted gray via Conditional Formatting, we could probably
figure out how to set up F2 to display "YES" at the same time that A2 gets
turned gray. The question would be what is the condition that causes A2 to
turn gray.

"pcor" wrote:

I want to place the word "YES" in cell F2 if the cell A2 background is gray.
How do I do that Thanks

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 99
Default tell if a cell is shaded

Hi,
I manage to do this having downloaded the free "morefunc" add-in.
First you need to find the number corresponding to your fill colour, so fill
a cell (say A1) with a grey colour (middle one one the right in my pallette),
and in A2 enter =XLM.GET.CELL(63,A1)
This will return a number, 48, in this case.
Now you know the number, you can get rid of the above.

Now, in F2, enter
=IF(XLM.GET.CELL(63,A2)=48,"YES","")

If A2 has a midgrey fill, then F2 will display the word YES, otherwise it
will display nothing.

The drawback is that it doesn't update automatically, so you need to force a
recalculation (with F9, for instance), and also it won't work if the fill is
applied with conditional formatting. In that case, you need to apply the same
logic to a formula in F2 that triggered the conditional formatting in A2.

Dave


"JLatham" wrote:

You'd have to do this with some macro code. Excel simply was never created
to make decisions based on cell shading or border color or style or anything
like that; it makes decisions based on the value/content of cells.

Now, if A2 is formatted gray via Conditional Formatting, we could probably
figure out how to set up F2 to display "YES" at the same time that A2 gets
turned gray. The question would be what is the condition that causes A2 to
turn gray.

"pcor" wrote:

I want to place the word "YES" in cell F2 if the cell A2 background is gray.
How do I do that Thanks

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
Shaded cells won't print shaded Linda C Excel Worksheet Functions 4 April 3rd 23 06:59 PM
shaded cell sumation oldLearner57 Excel Discussion (Misc queries) 2 April 23rd 08 09:52 PM
Show a row shaded when a cell contains certain data Gadgetman Setting up and Configuration of Excel 6 March 3rd 07 04:18 PM
returning either a shaded cell &/or a text d_kight Excel Discussion (Misc queries) 1 June 12th 06 01:52 PM
Need invisible/shaded/highlighted cell Tom Excel Discussion (Misc queries) 2 June 30th 05 07:52 PM


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

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

About Us

"It's about Microsoft Excel"