+ Reply to Thread
Results 1 to 10 of 10

Macro: AutoFill Dates

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Smile Macro: AutoFill Dates

    Hey Everyone!

    I've created a Gantt chart that spans over 3 or 4 years (2013-2018) with conditional formatting and I want to make it automatically fill in dates at the end of the chart. I'm fairly new when it comes to using VBA and I'm having trouble with my code.
    I managed to upload my chart so here it is!GANTT4-1.xlsm

    Please Login or Register  to view this content.
    I'm pretty much trying to find the earliest date out in Row 6 and then add a day to it so that whenever I press a button it will add the next day in the timeline. I know the problem is with the AddDate function but I have never used it before so I am not sure how to set it up. Any input would be great!
    Last edited by swiderskit3; 04-10-2014 at 07:35 PM.

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro: AutoFill Dates

    I would like to help but i have no idea what your trying to accomplish. I understand you want excel to somehow automatically fill in dates at the end of the chart. When you say chart are you referring to L6:BGE6? If so you said you want to find the earliest date out in row 6. What do you mean by earliest date out and why row 6, why not row 7 because in row 6 you don't have any dates there? What determines when the macro should stop adding dates because you already have it up to 1-1-2018.
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro: AutoFill Dates

    This is a dumby version of my actual document. I can't upload the real one. My real one is a Gantt Chart that I made with conditional formatting. It shows the dates of each of the categories. So milestones, start dates and end dates show up as lines underneath the timeline (the best way I can describe it it). I am not the one who will be using this document and the people who will be don't know how to work excel in the same way I do. I need a macro that will extend the time line in row seven with just the press of a button. I hope this makes sense! Thanks for the reply!

  4. #4
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro: AutoFill Dates

    I don't need another file. The one you have uploaded is good. I understand you want to push a button and extend the date however do you want it to always and only extend one date at a time and you will just press it enough times when you want it to stop extending or is there a criteria you want the macro to stop adding extending the date at?

    Try this if you just want to push the button to your content.

    Create the button and add this macro to the code for the button

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro: AutoFill Dates

    OMG You genius! I have been trying to figure this out for a month and driving myself crazy! You are the most amazing person ever! Thank you so much!

  6. #6
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro: AutoFill Dates

    I apologize for bothering you again! The code worked perfectly for my dumby chart but not for the chart I am using. I think it may be because there are a few for columns. The timeline is still in row 7 but the table that has the start date and end day is from B-O instead B-K. Thanks so much for your help again!

  7. #7
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro: AutoFill Dates

    The macro looks in row 7 starting with B7 and then goes right and finds the last cell in that row with data. So B-K or B-O won't matter. What does matter is if you have a blank cell say in P7 then the macro would stop there instead of at the end of the row where a date might be. Either upload your example or change B7 in the macro to whatever column begins the dates. IE if dates start in Q7 then change B7 in the macro to Q7.

  8. #8
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro: AutoFill Dates

    Ok I will try that! Thank you again!

  9. #9
    Registered User
    Join Date
    04-07-2014
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro: AutoFill Dates

    Oh my gosh it works! Thank you so much again! You have no idea how much you have just helped me!

  10. #10
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro: AutoFill Dates

    Anytime. I am glad it works. Thanks for the rep.

+ 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. Configure a Gantt Chart in excel to have dependent dates
    By brad.katronis2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2012, 04:47 PM
  2. [SOLVED] Gantt chart in excel (Formatting from dates)
    By Stndsh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-20-2011, 07:32 PM
  3. Modify Gantt Chart Dates
    By mycon73 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-01-2011, 02:20 PM
  4. Gantt chart using relative dates?
    By Poops in forum Excel General
    Replies: 1
    Last Post: 06-09-2007, 02:29 PM
  5. [SOLVED] Adding frills to a Gantt chart
    By ddflip in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-02-2006, 11:45 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