Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
cebubum
 
Posts: n/a
Default Conditional formatting of date

I want to compare a date in a cell to the current date. If the current date
is past the date in the specified cell, and the adjacent cell is blank, I
want the specified date to display in red. Would someone be so kind as to
assist me with this please.


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

You need conditional formatting.

Select the cell to format, and let's assume that the compare cell is A1
Menu FormatConditional Formatting
Change Condition1 to Formula Is
Add a formula of =AND(A1<TODAY(),B1="")
Click Format
Choose the text colour
OK
OK

--
HTH

Bob Phillips

"cebubum" wrote in message
...
I want to compare a date in a cell to the current date. If the current

date
is past the date in the specified cell, and the adjacent cell is blank, I
want the specified date to display in red. Would someone be so kind as to
assist me with this please.




  #3   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

the dates are in A1 to A20
in D1 enter
=today()

then try this sub

Public Sub test()
Dim cell As Range
For Each cell In Range("a1:a20")

If cell < Range("d1") Then
If cell.Offset(0, 1) = "" Then
cell.Font.ColorIndex = 3
Else

End If

End If
Next

End Sub


cutomise the sub to suit you.

each day the color may change.
========================
cebubum wrote in message
...
I want to compare a date in a cell to the current date. If the current

date
is past the date in the specified cell, and the adjacent cell is blank, I
want the specified date to display in red. Would someone be so kind as to
assist me with this please.




  #4   Report Post  
cebubum
 
Posts: n/a
Default

Thank you for responding. I think I can make this work now

"Bob Phillips" wrote:

You need conditional formatting.

Select the cell to format, and let's assume that the compare cell is A1
Menu FormatConditional Formatting
Change Condition1 to Formula Is
Add a formula of =AND(A1<TODAY(),B1="")
Click Format
Choose the text colour
OK
OK

--
HTH

Bob Phillips

"cebubum" wrote in message
...
I want to compare a date in a cell to the current date. If the current

date
is past the date in the specified cell, and the adjacent cell is blank, I
want the specified date to display in red. Would someone be so kind as to
assist me with this please.





  #5   Report Post  
cebubum
 
Posts: n/a
Default

Thanks a lot. Worked well

"R.VENKATARAMAN" wrote:

the dates are in A1 to A20
in D1 enter
=today()

then try this sub

Public Sub test()
Dim cell As Range
For Each cell In Range("a1:a20")

If cell < Range("d1") Then
If cell.Offset(0, 1) = "" Then
cell.Font.ColorIndex = 3
Else

End If

End If
Next

End Sub


cutomise the sub to suit you.

each day the color may change.
========================
cebubum wrote in message
...
I want to compare a date in a cell to the current date. If the current

date
is past the date in the specified cell, and the adjacent cell is blank, I
want the specified date to display in red. Would someone be so kind as to
assist me with this please.





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
Conditional Formatting Based on Date John F.M. Excel Discussion (Misc queries) 1 June 2nd 05 08:14 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
How do I set a date range for conditional formatting in a macro? billo Excel Worksheet Functions 3 February 7th 05 06:19 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
Conditional Formatting (Date vs Number) [email protected] Excel Discussion (Misc queries) 7 December 20th 04 10:23 PM


All times are GMT +1. The time now is 09:14 PM.

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"