Lag and Lead

J

Java Hound

I am trying :-( to write a macro to 'count' the number of tasks using lag and
/ or lead (one sum or two is fine). The object is TaskDependency.Lag correct?
Is there a TaskDependency.Lead? Lead is just negative lag, correct? I cannot
find it in the library. Would another way be to evaluate the Predecessor
string for + or - (i.e. FS-2d)? Thanks in advance.
MSP2002 for now.
 
J

JackD

This works in Project 2002:

Sub JavaHound()
Dim t As Task
Dim l As Long
Dim tCount As Integer
Dim tdeps As TaskDependencies
Dim tdep As TaskDependency

For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
Set tdeps = t.TaskDependencies
For Each tdep In tdeps
If tdep.To = t.ID Then
If tdep.Lag <> 0 Then
tCount = tCount + 1
End If
End If
Next tdep
End If
Next t
MsgBox "There are " & tCount & " tasks with lead or lag."
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top