Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default can you add months to a date?

can you add months to a date?
So for example you have a date. any date. like 5/20/2010
Then I want to add 6 months to the date. Then get 11/20/2010
Is there a way to do this in vba/excel?

thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default can you add months to a date?

greg wrote:
can you add months to a date?
So for example you have a date. any date. like 5/20/2010
Then I want to add 6 months to the date. Then get 11/20/2010
Is there a way to do this in vba/excel?

thanks


It depends on what you mean by "month".

For example, you have a date like "8/31/yyyy". Add 6 months. February...31?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default can you add months to a date?

hi
something like this might work for you'
assuming you have a date value in a cell......
Sub dateadd()
Dim d As Date
d = Range("I3").Value
d = DateSerial(Year(d), Month(d) + 6, Day(d))
MsgBox d
End Sub

regards
FSt1

"greg" wrote:

can you add months to a date?
So for example you have a date. any date. like 5/20/2010
Then I want to add 6 months to the date. Then get 11/20/2010
Is there a way to do this in vba/excel?

thanks



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
3 months prior and 3 months post a date renee Excel Worksheet Functions 2 May 2nd 08 05:46 PM
About calculate months between two date (date function) Hank Excel Discussion (Misc queries) 2 February 2nd 07 05:42 PM
Todays date plus 3 months & less 3 months Les Stout[_2_] Excel Programming 4 November 1st 06 05:55 PM
Convert date to length of time in months from set date MJUK Excel Worksheet Functions 1 March 19th 05 06:31 PM
Return a date 6 months from a date in another cell Qaspec Excel Worksheet Functions 1 January 21st 05 04:59 PM


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