Get WBS Parent RRS feed

  • Question

  • Hi All

    I have run in to a bit of an issue with Project and WBS codes. 

    My plan to fix this is with WBS codes. Is it possible to calculate the Level 2 parent as a custom field for each task?


    1. Project A

    1.1 Task A

    1.1.2 Do a thing

    Under this the object 1.1.2 would have a customer field which just lists it L2 parent so "Task A"

    Thanks in advance?

    Monday, May 22, 2017 9:51 AM

All replies

  • N3rden,

    The WBS you show in the example is missing 1.1.1 but I'll assume that is just a typo.

    This cannot be done with a formula in a custom field, VBA is required. You only mention level 2, so the following macro will put the outline level 2 task name into Text1 for each subtask of that parent task.

    Sub rolldownParent()
    Dim t As Task
    Dim st As Task
    For Each t In ActiveProject.Tasks
        If Not t Is Nothing Then
            If t.OutlineLevel = 2 Then
                For Each st In t.OutlineChildren
                    st.Text1 = t.Name
                Next st
            End If
        End If
    Next t
    End Sub


    Monday, May 22, 2017 1:10 PM