M
Marty
I have set up a number of macros that count the number of tasks that are 5,
10, 15, etc. days late. But, I haven't figured out how to keep each macro
from counting the other macros' tasks. The 5 days late task counts tasks up
to 5 days late, the 10 days late macro counts all tasks up to 10 days late,
including those tasks 5 days late. How do I keep from double counting the
tasks. Below is the code for my 5 days late macro. All the other macros
look exactly the same but with the larger number where the 5 is. What
expression would I use to replace the greater than or equal to expression to,
for instance, limit the 10 days late macro to all tasks greater than or equal
to 10 days and less than or equal to 14 days late?
Sub Tasks_Plus5()
Dim t As Task
Dim C As Long
For Each t In ActiveProject.Tasks
If Not (t Is Nothing) Then
If t.Summary = False Then
If t.PercentComplete < 100 Then
If t.Start <= Now() Then
If t.Finish <= Now() - 5 Then
C = C + 1
End If
End If
End If
End If
End If
Next t
ActiveProject.ProjectSummaryTask.Text3 = C
End Sub
10, 15, etc. days late. But, I haven't figured out how to keep each macro
from counting the other macros' tasks. The 5 days late task counts tasks up
to 5 days late, the 10 days late macro counts all tasks up to 10 days late,
including those tasks 5 days late. How do I keep from double counting the
tasks. Below is the code for my 5 days late macro. All the other macros
look exactly the same but with the larger number where the 5 is. What
expression would I use to replace the greater than or equal to expression to,
for instance, limit the 10 days late macro to all tasks greater than or equal
to 10 days and less than or equal to 14 days late?
Sub Tasks_Plus5()
Dim t As Task
Dim C As Long
For Each t In ActiveProject.Tasks
If Not (t Is Nothing) Then
If t.Summary = False Then
If t.PercentComplete < 100 Then
If t.Start <= Now() Then
If t.Finish <= Now() - 5 Then
C = C + 1
End If
End If
End If
End If
End If
Next t
ActiveProject.ProjectSummaryTask.Text3 = C
End Sub