none
Expanding all subtasks from a summary level RRS feed

  • Question

  • Hi

    Am I missing something or is MSP missing something? I want to be able to expand ALL subtasks from a particular summary level in a large plan.

    It appears the options available to me are; expand one level only OR expand ALL tasks for the entire plan.

    My current method is to laboriously select and expand the top summary level then highlight all the nested summary level tasks that appear under that, click expand again, then highlight all the nested summary levels and expand e.t.c. e.t.c until I can finally see all the tasks and subtasks under that particular top summary level section of the plan.

    Thanks in advance.

    Tuesday, May 1, 2018 12:09 PM

Answers

  • To those who may be following this thread,

    Here is the promised VBA to fully expand a selected summary level without expanding the whole file or any outline level thereof (i.e. it works around Project's ribbon View > data group > Outline limitations)

    John

    'This procedure will fully expand a selected summary level whether it is a single
    '   ssummary or multiple summary levels that are either contiguous or non-contiguous
    'Written by John - Project 4/3/18
    Sub ExpandSelected()
    Dim t As Task
    Dim st As Task
    Dim i As Integer
    'This allows for selection of multiple summary lines
    For Each t In ActiveSelection.Tasks
        If Not t Is Nothing Then
            'first expand selected summary
            t.OutlineShowSubTasks
            'store ID of summary and it's outline level
            TID = t.ID
            OL = t.OutlineLevel
            i = TID + 1
            'create object representing next task (simplfies typing)
            Set st = ActiveProject.Tasks(i)
            'loop through successive tasks looking for summary lines to expand until
            '   outline level of originally selected summary is encountered
            Do While st.OutlineLevel > OL
                If st.Summary = True Then st.OutlineShowSubTasks
                i = i + 1
                Set st = ActiveProject.Tasks(i)
            Loop
        End If
    Next t
    End Sub

    • Marked as answer by Mannie123 Friday, May 4, 2018 5:59 PM
    Thursday, May 3, 2018 11:12 PM

All replies

  • Mannie123 --

    In the Data section of the View ribbon, you will find the Outline pick list button.  Using this button will allow you to expand or collapse summary tasks at the outline level you desire.  Would this feature work in your situation?  Let us know and we will try to help you.


    Dale A. Howard [MVP]

    Tuesday, May 1, 2018 12:59 PM
    Moderator
  • Hi

    Thanks for quick reply.

    No sadly that is what I have been doing but that way of doing it is limited.

    Any expansion to the summary level to any outline level I choose automatically applies to the whole plan.

    I want to be able to highlight a summary level row and get MSP to expand all summary levels nested in that section only.

    I have to expand a section then scroll through the entire section, highlight additional summary levels that have appeared, click Show subtasks again and then keep repeating this process until all the summaries have been manually highlighted and opened.

    Tuesday, May 1, 2018 2:53 PM
  • Mannie,

    Have you tried this?

    1. View Ribbon / Outline / All Subtasks.

    2. View Ribbon / Outline / Outline Level # (where # is the outline level of the summary task you want to open).

    3. Select summary task to open / Click the plus sign.

    It may not be exactly what you want, but I think it will get you closer than the process you describe.

    (When using your described process to open multiple parallel summaries, experience has taught me to start at the bottom - at least that cuts out some extra scrolling.)

    Tuesday, May 1, 2018 4:33 PM
  • Mannie123,

    You are not missing anything. Project simply will not support what you want to do in any automated fashion, to do so requires the use of VBA. In the back of my mind I recall addressing this same issue for another user in the past with a macro but unfortunately either I'm not remembering correctly or I can't find the code I wrote for that response and the search capabilities of this forum frankly sucks.

    I will be happy to create the necessary VBA code to do what you want but it will be a few days as I currently have other priorities.

    John

    Wednesday, May 2, 2018 2:44 PM
  • To those who may be following this thread,

    Here is the promised VBA to fully expand a selected summary level without expanding the whole file or any outline level thereof (i.e. it works around Project's ribbon View > data group > Outline limitations)

    John

    'This procedure will fully expand a selected summary level whether it is a single
    '   ssummary or multiple summary levels that are either contiguous or non-contiguous
    'Written by John - Project 4/3/18
    Sub ExpandSelected()
    Dim t As Task
    Dim st As Task
    Dim i As Integer
    'This allows for selection of multiple summary lines
    For Each t In ActiveSelection.Tasks
        If Not t Is Nothing Then
            'first expand selected summary
            t.OutlineShowSubTasks
            'store ID of summary and it's outline level
            TID = t.ID
            OL = t.OutlineLevel
            i = TID + 1
            'create object representing next task (simplfies typing)
            Set st = ActiveProject.Tasks(i)
            'loop through successive tasks looking for summary lines to expand until
            '   outline level of originally selected summary is encountered
            Do While st.OutlineLevel > OL
                If st.Summary = True Then st.OutlineShowSubTasks
                i = i + 1
                Set st = ActiveProject.Tasks(i)
            Loop
        End If
    Next t
    End Sub

    • Marked as answer by Mannie123 Friday, May 4, 2018 5:59 PM
    Thursday, May 3, 2018 11:12 PM
  • Thanks for your time giving the suggestion. Yes it is a pain but am improvement on my previous method of execution :)
    Friday, May 4, 2018 6:00 PM
  • You are a legend. It really does work!!

    When I expanded the last/final summary section of a plan it came up with a VB error pointing to this line:

                 Set st = ActiveProject.Tasks(I)

    BUT it still works fine. I just ignore/click END on the debug prompt.

    Invaluable to the time it takes me to navigate through some big plans (9000 rows at the moment) and scrutinise the data.

    THANKS AGAIN

    Friday, May 4, 2018 6:06 PM
  • Mannie123,

    Of course it works, except for that little error glitch. Here is Rev A.

    You're welcome and thanks for the feedback.

    John

    'This procedure will fully expand a selected summary level whether it is a single
    '   ssummary or multiple summary levels that are either contiguous or non-contiguous
    'Written by John - Project 5/3/18
    '   Rev A 5/4/18 - fixed error that occurs when last summary in file is selected
    Sub ExpandSelected()
    Dim t As Task
    Dim st As Task
    Dim i As Integer
    'This allows for selection of multiple summary lines
    For Each t In ActiveSelection.Tasks
        If Not t Is Nothing Then
            'first expand selected summary
            t.OutlineShowSubTasks
            'store ID of summary and it's outline level
            TID = t.ID
            OL = t.OutlineLevel
            i = TID + 1
            'create object representing next task (simplfies typing)
            Set st = ActiveProject.Tasks(i)
            'loop through successive tasks looking for summary lines to expand until
            '   outline level of originally selected summary is encountered
            Do While st.OutlineLevel > OL
                If st.Summary = True Then st.OutlineShowSubTasks
                If i = ActiveProject.Tasks.count Then Exit Do
                i = i + 1
                Set st = ActiveProject.Tasks(i)
            Loop
        End If
    Next t
    End Sub

    Friday, May 4, 2018 8:11 PM
  • Great thanks sir! 

    I was looking for exactly the same thing as expanding only one (or several but not all) summary task to the last outline SHOULD be a normal MSP feature. I did not find it and thought I was a useless software explorer... but doing some digging on the web... confirmed me this feature was not obvious for MSP programmers... too bad!

    I was also on my way of coding that in VBA but you did it for us. Thanks to you again!

    Cheers!

    Mac

    Monday, November 18, 2019 4:33 PM
  • Mac,

    You're welcome and thanks for the feedback.

    John

    Monday, November 18, 2019 4:58 PM