+ Reply to Thread
Results 1 to 7 of 7

Return max finish date for projects using VBA

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    9

    Return max finish date for projects using VBA

    I have a spreadsheet containing milestones for several different projects. The number of milestones per project varies.

    I need to get the max date for each project using VBA.

    Simple Example:
    'Project Name' is in column A and the 'Scheduled Finish Date' is in column B.

    Project X has 5 milestones with the following Scheduled Finish Dates: (8/15, 8/16, 8/17, 8/18, 8/19)
    Project Y has 3 milestones with the following Scheduled Finish Dates: (8/20, 8/21, 8/22)
    Project Z has 6 milestones with the following Scheduled Finish Dates: (8/23, 8/24, 8/25, 8/26, 8/27, 8/28)


    I need the macro to return 8/19 for Project X, 8/22 for Project Y and 8/28 for Project Z.

    Anyone know the code that would do this?

    Any help is greatly appreciated!

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Return max finish date for projects using VBA

    I have no idea where you would like to place the dates or whatsoever, and this is assuming the dates are sorting in ascending order. It will show the date in a message box based on selected cell.

    Please Login or Register  to view this content.
    If you would like the dates displayed in a 3rd column, it's better to use a formula, unless you would like the macro to insert the column.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    08-01-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Return max finish date for projects using VBA

    Thanks Millz. I should have mentioned above that I want to get the max finish date for each project and put it in a separate sheet that doesn't have duplicate project names.

    Is there a way to write in the max finish date in the sheet with each project only listed once?

    Thanks!

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Return max finish date for projects using VBA

    What duplicate project names? I am lost.

    Show a sample data sheet, and as well the 'separate' sheet that holds the results?

  5. #5
    Registered User
    Join Date
    08-01-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Return max finish date for projects using VBA

    Millz - see attached very simple example. The first sheet is the data source that would be extracted from a SharePoint list. The second sheet is what I would like the macro to write in. I would like the macro to write in the project name and the max finish date.

    I should have mentioned in my first posting that there will be duplicate project names because each project will have milestones.

    Sample Max Finish Date.xlsx

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Return max finish date for projects using VBA

    Try the attached file, I did not add anything fancy to make up the borders though, just purely inserting values.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-01-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    9

    Talking Re: Return max finish date for projects using VBA

    Millz - thank you very much! This is exactly what I needed. This will make things a lot easier for me. Can't thank you enough!

+ 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] Return start and finish date
    By kaypump in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-25-2014, 12:43 PM
  2. Calculate start date from finish date minus 14 working hours
    By PietBom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2014, 07:23 PM
  3. [SOLVED] VBA to return the column numbers of the start and finish of a merged cell? RANDOM!
    By JamesGoulding85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-28-2013, 01:32 PM
  4. Make date ranges for graph (choose start and finish date)
    By zeko90 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2013, 09:13 AM
  5. Replies: 5
    Last Post: 06-30-2011, 03:26 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