View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
david mcritchie david mcritchie is offline
external usenet poster
 
Posts: 691
Default Conditional Formatting on Time

Hi Scott,
Actually you should be in Worksheet.Functions since this is
builtin Excel worksheet functions.

I'm not sure what you want even after rewording, but it seems like
if the date in Column A is the same as the current date then the
cell is to remain uncolored; otherwise color the cell.

Formula 1 is: =OR($A1 < TODAY(), $A1 TODAY() )
or
Formula 1 is: =$A1<TODAY()


If you want three different colors:
Formula 1 is: =$A1 < TODAY()
Formula 2 is: =$A1 = TODAY()
Formula 3 is: =$A1 TODAY()

The formula used is based on the active cell.

By using $A1 in the formula you can select
the single cell A1 for coloring
or by selecting Column A, each cell in A is tested and colored if needed.

or by selecting the entire sheet with cell A1 as the active cell, each row
will be colored depending on the value in column A of each row.

I have a page on Conditional Formatting:
http://www.mvps.org/dmcritchie/excel/condfmt.htm

This was a test on date if you really mean time as in MOD(NOW(),1)
then just a little more information, because the window of not being smaller
or larger is going to be VERY small.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message ...
Sorry, I just read my post and it might be confusing, hope
this makes more sense.

if the time in A1 is before or after the current time, I
want the conditional formatting to return a specific color.
Ive tried =A1Now() and =A1<Now() but cant seem to get it
to work. In A1, Ive set the number category to time and
the type is h:mm AM/PM.

-----Original Message-----
Hopefully im in the right section for this question.

Is it possible to base a conditional format on the =Now()
expression? Basicly if the time is before or after the
time, I want the conditional formatting to return a
specific color. Ive tried =A1NOW() and set A1 to display
time, but I cant seem to get it to work. Thanks for the
help.
.