【发布时间】:2021-06-06 01:24:48
【问题描述】:
我尝试使用 Microsoft 项目 VBA 查找潜在客户,但没有成功我尝试了以下代码,但它给了我 2280 个潜在客户,而我的日程安排中的关系总数为 2156
Sub NumberofLeads()
Dim Lead As Integer
Dim t As Task
Dim td As TaskDependency
Lead = 0
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
For Each td In t.TaskDependencies 'looping in all the relations of a task
If td.Lag < 0 Then
Lead = Lead + 1
End If
Next
End If
Next t
MsgBox Lead & " Leads exist."
End Sub
【问题讨论】:
标签: vba project ms-project