none
Identifying Task Dependency Types in MS Project (FS, FF, SS, SF) using VBA RRS feed

  • Question

  • Hi

    I need some help in finding out how to identify a Task Dependency type in MS project 2013.  I need to be able to count all of the dependency types in a plan and work out the percentage of those that have a FS task dependency.

    Any help/guidance would be appreciated.

    Kind regards

    Tony


    TKHussar

    Tuesday, May 10, 2016 10:34 AM

Answers

  • function tst() as Single
        Dim t As Task, ctFS As Integer, ct as Integer
        ctFS = 0
        ct = 0
        For Each t In ActiveProject.Tasks
            Dim d As TaskDependency
            For Each d In t.TaskDependencies
                If d.To.ID = t.ID Then
                    If d.Type = pjFinishToStart Then ctFS = ctFS + 1
                    ct = ct + 1
                End If
            Next
        Next
        tst = ctFS / ct
    End Function 
    
    That oughta handle it.
    Tuesday, May 10, 2016 2:09 PM

All replies

  • function tst() as Single
        Dim t As Task, ctFS As Integer, ct as Integer
        ctFS = 0
        ct = 0
        For Each t In ActiveProject.Tasks
            Dim d As TaskDependency
            For Each d In t.TaskDependencies
                If d.To.ID = t.ID Then
                    If d.Type = pjFinishToStart Then ctFS = ctFS + 1
                    ct = ct + 1
                End If
            Next
        Next
        tst = ctFS / ct
    End Function 
    
    That oughta handle it.
    Tuesday, May 10, 2016 2:09 PM
  • Hi Bill

    Many thanks - works like a dream.

    Thanks again.

    Kind regards

    Tony


    TKHussar

    Wednesday, May 11, 2016 7:42 AM