none
Showing information from Summary task in subtask RRS feed

  • Question

  • Hi,

    Is it possible to show information from a Summary task in it´s subtasks?

    Have a custom field which calculates the current status (+/- number of days) of each Project, showing the number of days the Project is ahead or after Schedule. Can then access this information using VBA in many good ways.

    Would also like to show this info in some reports and the optimal would be to create a custom field which could hold the information from the Summary taks (+/-) column. Then each task would have a field with the status.

    As per the below image it is the "5" in the yellow field that should be read to Another custom field for it´s subtasks.

    Grateful for any ideas about this.

    Kind regards //Anders

    Monday, October 12, 2015 11:23 AM

Answers

  • AT_Iamnea,

    Unless I'm misunderstanding what you want, this is a trivial macro. Assuming the custom field you already have for the summary line value is the Number1 field, the following code will copy that value into the Number2 field of each subtask under each summary.

    Sub flowdown()
    Dim t As Task
    Dim st As Task
    For Each t In ActiveProject.Tasks
        If Not t Is Nothing Then
            If t.Summary Then
                For Each st In t.OutlineChildren
                    st.Number2 = t.Number1
                Next st
            End If
        End If
    Next t
    End Sub

    John

    • Marked as answer by AT_lamnea Monday, October 12, 2015 6:57 PM
    Monday, October 12, 2015 3:50 PM
  • Anders,

    Okay, it looks like you're all set with this one.

    John

    • Marked as answer by AT_lamnea Tuesday, October 13, 2015 2:22 PM
    Tuesday, October 13, 2015 2:21 PM

All replies

  • AT_Iamnea,

    Unless I'm misunderstanding what you want, this is a trivial macro. Assuming the custom field you already have for the summary line value is the Number1 field, the following code will copy that value into the Number2 field of each subtask under each summary.

    Sub flowdown()
    Dim t As Task
    Dim st As Task
    For Each t In ActiveProject.Tasks
        If Not t Is Nothing Then
            If t.Summary Then
                For Each st In t.OutlineChildren
                    st.Number2 = t.Number1
                Next st
            End If
        End If
    Next t
    End Sub

    John

    • Marked as answer by AT_lamnea Monday, October 12, 2015 6:57 PM
    Monday, October 12, 2015 3:50 PM
  • John,

    You very well understood, which only that was quite an effort to do, it was rather poorly explained. However, you did not only understand the question, you did most probably come with the solution as well. Will try it first thing tommorow. Was first looking at somehow using a formula for a custom field and try to read the values from the summary task without running a macro, but it does not seem too work. However your code seems excellent.

    Thank you very much John!

    Kind regards //Anders



    Monday, October 12, 2015 6:56 PM
  • Anders,

    You're welcome and thanks for the feedback.

    Indeed, what you want cannot be done with formulas in custom fields, so VBA is really the only way to go.

    John

    Monday, October 12, 2015 7:58 PM
  • Hi again John,

    Ok, almost figured that so was the case, thanks for confirming.

    Have a good evening, here it is time to go to bed.

    Kind regards //Anders




    Monday, October 12, 2015 8:35 PM
  • Good morning John,

    Just for your information: It worked great, thank you very much!

    Kind regards //Anders

    Tuesday, October 13, 2015 5:54 AM
  • Anders,

    Okay, it looks like you're all set with this one.

    John

    • Marked as answer by AT_lamnea Tuesday, October 13, 2015 2:22 PM
    Tuesday, October 13, 2015 2:21 PM
  • Sure John, it is already in use.

    Thank you for excellent code.

    Kind regards //Anders

    Tuesday, October 13, 2015 2:23 PM