LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
wal wal is offline
external usenet poster
 
Posts: 19
Default Add years, months, days to a date

Excel 2003

With a worksheet function, you can add x years, y months, and z days
to a date using a formula like:

=DATE(YEAR(A1)+2, MONTH(A1)+3, DAY(A1)+4) [from Chip Pearson's site]

What is the analogous way of doing this in VBA? DATE is apparently
not a worksheet function available in VBA
(Application.WorksheetFunction). The DateAdd function in VBA lets you
add only one interval (years or months or days) at a time, and the
Help file examples don't go beyond this.

Thanks.
 
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
converting days to years & months & days oldLearner57 Excel Discussion (Misc queries) 4 October 2nd 09 01:57 PM
how do i convert a number of days to years, months & days? SafetyLen Excel Discussion (Misc queries) 1 August 23rd 07 01:34 AM
HOW DO I CALCULATE THE YEARS MONTHS AND DAYS BETWEEN SEVERAL DATE Susan Excel Discussion (Misc queries) 1 June 29th 06 02:27 PM
FORMULA FOR CALCULATING YEARS, DAYS, & MONTHS BETWEEN SEVERAL DATE Sam Excel Discussion (Misc queries) 3 June 28th 06 10:34 PM
Start Date minus (Years + Months + Days) = ? quartz[_2_] Excel Programming 3 May 11th 06 06:05 PM


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