Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 86
Default Reference a cell based on Fill color?

Is it possible to check if a cell has a fill color, preferably with an If
statement rather than a macro, but either way...

If not, is it possible to check if a cell has two "/", rather than just one?

Or even worse, how do you take the text string (it was typed in as text):
Sun 01/15/07 (but sometimes Sun 1/22/2007) and convert that to a numerical
date which can then have the month extrapolated?

I thank you in advance.

Arlen
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 169
Default Reference a cell based on Fill color?

You could try Cell("color",cell_ref)
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"Arlen" wrote:

Is it possible to check if a cell has a fill color, preferably with an If
statement rather than a macro, but either way...

If not, is it possible to check if a cell has two "/", rather than just one?

Or even worse, how do you take the text string (it was typed in as text):
Sun 01/15/07 (but sometimes Sun 1/22/2007) and convert that to a numerical
date which can then have the month extrapolated?

I thank you in advance.

Arlen

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 86
Default Reference a cell based on Fill color?

Apparently, that only works for conditional formatting, if cell text is
colored when it's a negative value.



"M Kan" wrote:

You could try Cell("color",cell_ref)
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"Arlen" wrote:

Is it possible to check if a cell has a fill color, preferably with an If
statement rather than a macro, but either way...

If not, is it possible to check if a cell has two "/", rather than just one?

Or even worse, how do you take the text string (it was typed in as text):
Sun 01/15/07 (but sometimes Sun 1/22/2007) and convert that to a numerical
date which can then have the month extrapolated?

I thank you in advance.

Arlen

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Reference a cell based on Fill color?

Is it possible to check if a cell has a fill color

You need VBA code. See this:

http://www.cpearson.com/Excel/colors.aspx

is it possible to check if a cell has two "/", rather than just one?


As long as the slashes are part of a TEXT string. This formula will return
the count of slashes in cell A1:

=LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))

Note that this won't work on true Excel dates. The slashes you (might) see
in a true date are from formatting and are for display purposes only. They
don't actually exist in the cell even though you do see them. In this case
seeing is not believing! <g

how do you take the text string...Sun 01/15/07
(but sometimes Sun 1/22/2007) and convert that to
a numerical date which can then have the month extrapolated?


If the day is *always* in ddd format:

To extract the month as a text string:

=TEXT(MID(A1,5,20),"mmm") = Jan
=TEXT(MID(A1,5,20),"mmmm") = January

If the day might vary in length:

=TEXT(MID(A1,FIND(" ",A1)+1,20),"mmm")
=TEXT(MID(A1,FIND(" ",A1)+1,20),"mmmm")

If you want the result as a true Excel date:

These should work but I'm more comfortable with the longer formulas below:

=--MID(A1,5,20)
=--MID(A1,FIND(" ",A1)+1,20)

=--TEXT(MID(A1,5,20),"m/d/yyyy")
=--TEXT(MID(A1,FIND(" ",A1)+1,20),"m/d/yyyy")

Format as DATE

--
Biff
Microsoft Excel MVP


"Arlen" wrote in message
...
Is it possible to check if a cell has a fill color, preferably with an If
statement rather than a macro, but either way...

If not, is it possible to check if a cell has two "/", rather than just
one?

Or even worse, how do you take the text string (it was typed in as text):
Sun 01/15/07 (but sometimes Sun 1/22/2007) and convert that to a numerical
date which can then have the month extrapolated?

I thank you in advance.

Arlen



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 I auto fill a cell patern or color based on a pick list? bbjr Excel Discussion (Misc queries) 3 April 21st 08 07:50 PM
How do you fill a cell with a color based on IFTHEN formula? ctbowling Excel Worksheet Functions 1 May 9th 06 04:11 PM
I want to fill the cell color based upon the other cell condition sri Excel Discussion (Misc queries) 4 January 12th 06 01:47 PM
How do I change fill color in excel based on data in the cell Jason Southco Excel Worksheet Functions 1 September 29th 05 04:56 PM
I am trying to color fill a cell based on specific criteria jglen Excel Discussion (Misc queries) 1 May 27th 05 05:30 PM


All times are GMT +1. The time now is 02:48 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"