LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default how do I put today's date and other dates in macro condition?

I have the following macro where I have dates embedded in certain cells
because I do not know how to put them in a condition statement. In the macro
below cell $R$1 is Today(), cell $S$1 is 01/01/00 and cell $T$1 is Today() +
7. How can I make the macro work with refering to the values in the cells?


Sub todaydate()


Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=$S$1", Formula2:="=$R$1"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.ColorIndex = 3
End With
Selection.FormatConditions(1).Interior.ColorIndex = 36
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=$R$1", Formula2:="=$T$1"
Selection.FormatConditions(2).Font.ColorIndex = 41
Selection.FormatConditions(2).Interior.ColorIndex = 36
Range("A1").Select

End Sub
 
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
Macro to jump to today's date Victor Delta Excel Discussion (Misc queries) 9 July 4th 06 08:52 PM
Are 2 dates between today's date Pivot Table/Query Excel Programming 1 September 8th 05 09:43 PM
set cell to today's date macro Colm O'Brien Excel Programming 3 May 28th 04 11:56 AM
Macro to filter on today's date Mike Boardman Excel Programming 2 October 3rd 03 01:49 AM
Macro to filter on today's date Mike B[_4_] Excel Programming 0 October 1st 03 09:17 AM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"