View Single Post
  #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.