VBA to calculate total number of tasks (no summary tasks) in a pro

M

Marty

I have been hacking away at this code for a while. Would anybody out there
be willing to provide an example of VBA that will calculate all the tasks in
a project without any of the summary tasks?
 
B

Brian K - Project MVP

Marty said:
I have been hacking away at this code for a while. Would anybody out there
be willing to provide an example of VBA that will calculate all the tasks
in
a project without any of the summary tasks?

Sub CountTasks()
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
C = C + 1
End If
End If
Next T

MsgBox Prompt:="The Project Contains " _
& C & " non-Summary tasks"

End Sub
 
M

Marty

Thanks a ton Brian. It works like a champ!!

Brian K - Project MVP said:
Sub CountTasks()
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
C = C + 1
End If
End If
Next T

MsgBox Prompt:="The Project Contains " _
& C & " non-Summary tasks"

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