Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jer jer is offline
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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   Report Post  
Posted to microsoft.public.excel.programming
jer jer is offline
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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
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
Scheduling Matt Excel Discussion (Misc queries) 0 May 16th 10 02:17 AM
Scheduling... Maxime Maugeais Excel Discussion (Misc queries) 3 June 20th 07 05:21 AM
Calculating dates - complex scheduling problem jct Excel Worksheet Functions 1 February 22nd 06 08:01 PM
Scheduling employees by dates... LOOKUP or FILTER? ssleene Excel Worksheet Functions 0 November 14th 05 06:58 PM
Scheduling Adam R via OfficeKB.com Excel Discussion (Misc queries) 1 July 15th 05 10:30 PM


All times are GMT +1. The time now is 08:28 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"