R
RyanT
So I'm looking to create a custom field column (eg. Flag5) that indicates
'yes' or 'no' whether the predecessors for any given task are complete
(100%). The only possible solution I can think of is a macro. I have one
that works but I would like to implement it so that it updates when there is
any change to the data in the project. Here's what I have:
Private Sub PredEdit()
Dim countTsk As Task
Dim checkTsk As Task
Dim allTsks As Tasks
Dim predTsks As Tasks
Dim i As Single
Dim j As Single
Set allTsks = ActiveProject.Tasks
For Each countTsk In allTsks
Set predTsks = countTsk.PredecessorTasks
i = 0
For Each checkTsk In predTsks
j = predTsks.Count
If checkTsk.PercentComplete = "100" Then
i = i + 1
End If
If j = i Then
countTsk.Flag5 = "Yes"
Else
countTsk.Flag5 = "No"
End If
Next checkTsk
Next countTsk
End Sub
Perhaps this isn't the best way to accomplish this task. I'm open to any
ideas. Thanks.
-Ryan
'yes' or 'no' whether the predecessors for any given task are complete
(100%). The only possible solution I can think of is a macro. I have one
that works but I would like to implement it so that it updates when there is
any change to the data in the project. Here's what I have:
Private Sub PredEdit()
Dim countTsk As Task
Dim checkTsk As Task
Dim allTsks As Tasks
Dim predTsks As Tasks
Dim i As Single
Dim j As Single
Set allTsks = ActiveProject.Tasks
For Each countTsk In allTsks
Set predTsks = countTsk.PredecessorTasks
i = 0
For Each checkTsk In predTsks
j = predTsks.Count
If checkTsk.PercentComplete = "100" Then
i = i + 1
End If
If j = i Then
countTsk.Flag5 = "Yes"
Else
countTsk.Flag5 = "No"
End If
Next checkTsk
Next countTsk
End Sub
Perhaps this isn't the best way to accomplish this task. I'm open to any
ideas. Thanks.
-Ryan