Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default macro to color all text red in worksheet if within certain date

I understand that you can use the Conditional formatting tool to change the
font of a cell based on the actual content of the cell, but I'm looking for a
macro to change the font color of the entire sheet if the date of a
particular cell is within a certain time.

For example on cell A1 would = date(2007,9,12). The condition would be if
the date in A1 is greater than 9/12/2007 then the macro would color the
entire worksheet red.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro to color all text red in worksheet if within certain date

Select all the cells on the worksheet (or just the range you want).

And with A1 the activecell
format|conditional formatting|
Formula is:
=$A$1DATE(2007,9,12)

The $a$1 tells excel to use A1 as the cell to use for all the cells you've
selected.

And format it the way you want.

Davidi wrote:

I understand that you can use the Conditional formatting tool to change the
font of a cell based on the actual content of the cell, but I'm looking for a
macro to change the font color of the entire sheet if the date of a
particular cell is within a certain time.

For example on cell A1 would = date(2007,9,12). The condition would be if
the date in A1 is greater than 9/12/2007 then the macro would color the
entire worksheet red.

Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default macro to color all text red in worksheet if within certain date

this may do what you want, just put this line in your code:

if range("A1").Value dateserial(2007,9,12) then cells.Font.Colorindex = 3

--


Gary


"Davidi" wrote in message
...
I understand that you can use the Conditional formatting tool to change the
font of a cell based on the actual content of the cell, but I'm looking for a
macro to change the font color of the entire sheet if the date of a
particular cell is within a certain time.

For example on cell A1 would = date(2007,9,12). The condition would be if
the date in A1 is greater than 9/12/2007 then the macro would color the
entire worksheet red.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default macro to color all text red in worksheet if within certain dat

Great, thank you Dave.

"Dave Peterson" wrote:

Select all the cells on the worksheet (or just the range you want).

And with A1 the activecell
format|conditional formatting|
Formula is:
=$A$1DATE(2007,9,12)

The $a$1 tells excel to use A1 as the cell to use for all the cells you've
selected.

And format it the way you want.

Davidi wrote:

I understand that you can use the Conditional formatting tool to change the
font of a cell based on the actual content of the cell, but I'm looking for a
macro to change the font color of the entire sheet if the date of a
particular cell is within a certain time.

For example on cell A1 would = date(2007,9,12). The condition would be if
the date in A1 is greater than 9/12/2007 then the macro would color the
entire worksheet red.

Thanks.


--

Dave Peterson

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
Change color of text if date is overdue Lynora Excel Worksheet Functions 2 January 23rd 09 09:57 PM
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
Change text color of specific date range by macro in Excel Morgan LeFay Excel Programming 1 August 3rd 06 07:51 PM
Color cell text based on date Gary''s Student Excel Programming 0 November 10th 05 12:36 AM
How to use macro to rename worksheet with date +"text" Sherri[_3_] Excel Programming 4 April 28th 04 12:05 AM


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