View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
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.