Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
scheduling dates
dear all
I have a worksheet with a comlum of dates is there a way to increment the dates using code for example existing results column column (e.g. after adding 6 months) 10/15/05 04/15/06 10/15/05 04/15/06 10/16/05 04/16/06 I know I can acheive this with the formula =DATE(YEAR(A1),MONTH(A1)+6,DAY(A1)) but is there a simple way to do this with code -- thanks as always for the help jer |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
scheduling dates
On Wed, 19 Oct 2005 15:52:08 -0700, jer wrote:
dear all I have a worksheet with a comlum of dates is there a way to increment the dates using code for example existing results column column (e.g. after adding 6 months) 10/15/05 04/15/06 10/15/05 04/15/06 10/16/05 04/16/06 I know I can acheive this with the formula =DATE(YEAR(A1),MONTH(A1)+6,DAY(A1)) but is there a simple way to do this with code There is a very similar VBA function: DateSerial(Year(dt1), Month(dt1) + 6, Day(dt1)) Of course, that has the same limitations as does the worksheet function when it comes to dealing with end of the month issues. It may be simpler to use the DateAdd function which takes end of the month issues into account: DateAdd("m", 6, dt1) --ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
scheduling dates
Thanks Ron
-- thanks as always for the help jer "Ron Rosenfeld" wrote: On Wed, 19 Oct 2005 15:52:08 -0700, jer wrote: dear all I have a worksheet with a comlum of dates is there a way to increment the dates using code for example existing results column column (e.g. after adding 6 months) 10/15/05 04/15/06 10/15/05 04/15/06 10/16/05 04/16/06 I know I can acheive this with the formula =DATE(YEAR(A1),MONTH(A1)+6,DAY(A1)) but is there a simple way to do this with code There is a very similar VBA function: DateSerial(Year(dt1), Month(dt1) + 6, Day(dt1)) Of course, that has the same limitations as does the worksheet function when it comes to dealing with end of the month issues. It may be simpler to use the DateAdd function which takes end of the month issues into account: DateAdd("m", 6, dt1) --ron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
scheduling dates
On Thu, 20 Oct 2005 08:39:04 -0700, jer wrote:
Thanks Ron -- thanks as always for the help jer You're welcome. Glad to help. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Scheduling | Excel Discussion (Misc queries) | |||
Scheduling... | Excel Discussion (Misc queries) | |||
Calculating dates - complex scheduling problem | Excel Worksheet Functions | |||
Scheduling employees by dates... LOOKUP or FILTER? | Excel Worksheet Functions | |||
Scheduling | Excel Discussion (Misc queries) |