Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks all, it wasn't as hard as I thought at first, this works:
' Prepopulate the data for the first of the month, plus 60 days hence. Today = Date ' Now add 60 days NextDate = DateAdd("d", 60, Today) Dayte = Day(NextDate) If (Dayte = 1) Then ' do nothing, it's the right day dFinalDate = dDayte Else ' Need to find the 1st of the following month Dayte = Dayte - 1 dFinalDate = DateAdd("m", 1, NextDate) dFinalDate = DateAdd("d", -Dayte, dFinalDate) End If Range("E8").Value = dFinalDate By all means comment if you see any problems or can make it more efficient, thanks again! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
date query | Excel Discussion (Misc queries) | |||
Date query | Excel Worksheet Functions | |||
Date Query | Excel Discussion (Misc queries) | |||
How do I enter a date range ie -7 from current date in MS QUERY | Excel Discussion (Misc queries) | |||
Date query | Excel Programming |