+ Reply to Thread
Results 1 to 3 of 3

Adding months to a date in a vba formula

  1. #1
    Registered User
    Join Date
    12-13-2017
    Location
    Ieper, Belgium
    MS-Off Ver
    2013
    Posts
    2

    Adding months to a date in a vba formula

    Hello,

    I am having the following problem in Excel (2013):

    I am trying to add up months to a date, using the function "Zelfde.dag" (this is in Dutch, the function in English is EDATE() I think).

    This is no problem as long as one adds this formula directly into the cells in Excel. However, I am trying to program the same thing into a vba module, using the following syntax : activecell.FormulaR1C1 = "=ZELFDE.DAG(RC[-2],RC[-1])". So this formula added to the activecell (in my case in cell D7) renders the new date based on adding the data in cells B7 and C7. B7 is a date, C7 is a number between 1 and 12. I then make the sub work by means of a button specially made for this purpose. This results, however, in an error #name? .
    What could be wrong with this ? Is this a bug in vba ?
    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,301

    Re: Adding months to a date in a vba formula

    Use the english function names in the vba editor:
    Please Login or Register  to view this content.
    What is the effect ?

  3. #3
    Registered User
    Join Date
    12-13-2017
    Location
    Ieper, Belgium
    MS-Off Ver
    2013
    Posts
    2

    Thumbs up Re: Adding months to a date in a vba formula

    Hi PV,

    It worked. Thanks a lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Adding number of months from date
    By bouncingbudha in forum Excel General
    Replies: 3
    Last Post: 05-13-2014, 06:34 PM
  2. Adding a number of months to a start date to obtain an 'end date'
    By SamURW in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2014, 07:19 PM
  3. Adding 3 calendar months to a date
    By Shirley Munro in forum Excel General
    Replies: 1
    Last Post: 10-12-2006, 06:18 PM
  4. Adding 6 months to any given date
    By hoyt in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 07-10-2006, 03:34 AM
  5. Adding 6 Months to a Date
    By Excel User in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-17-2006, 03:45 PM
  6. Adding a Specified Number of Months to a Date
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 11:57 AM
  7. adding months to an inputted date
    By BLW in forum Excel General
    Replies: 5
    Last Post: 06-08-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1