+ Reply to Thread
Results 1 to 8 of 8

Help! Automatically roll out a series of date by adjusting the duration

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    4

    Lightbulb Help! Automatically roll out a series of date by adjusting the duration

    Hi All!

    I am new to VBA and need some help to write a code to auto-generate a date series controlled by a limit.

    Example:

    In cell A1 I input 12 (which means next 12-months) and in A2 is today's date, I'd like to have a series of date of the next 12 months automatically generated in the cell A3 and beyond (Feb 14, 2015, march 14 2015, etc.).

    I'd like it to be dynamic so when I change the value in A1 the date range also expand/shorten automatically.

    Thanks a lot!!!!

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Try this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-14-2015
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    4

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Thanks Yasser!

    I just tried and I realized I miscommunicated in my original post - the range should be in a row not a column so starting cell C1,D1,E1...Also the year begins with 1900 instead of 2015. Could you design another one?

    Cheers

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Please Login or Register  to view this content.
    Put the integer in A1 . The start date in A2
    The results will be as you mentioned in the last post

  5. #5
    Registered User
    Join Date
    01-14-2015
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    4

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Thanks! It only goes to 11 months somehow when I input 12.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Help! Automatically roll out a series of date by adjusting the duration

    I tested it and everything is ok
    Do you want the date entered in A2 to be in results??

  7. #7
    Registered User
    Join Date
    01-14-2015
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    4

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Yes Please

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Help! Automatically roll out a series of date by adjusting the duration

    Try
    Please Login or Register  to view this content.

+ 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. Adjusting Series Formats in VBA
    By ParkerExcel in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-06-2012, 12:53 PM
  2. Roll down - automatically fill in
    By marovic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2011, 03:50 PM
  3. Adding a series of duration times
    By Tiresias in forum Excel General
    Replies: 7
    Last Post: 03-30-2009, 12:54 AM
  4. Automatically adjusting X axis date range
    By RubberToe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-19-2008, 02:53 PM
  5. [SOLVED] VBA that automatically generates a series of cash flows based on a start date, an end date and frequency
    By tamzik@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-27-2005, 06:10 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