【发布时间】:2017-02-15 21:20:41
【问题描述】:
对不起,如果这是一个简单的问题,我刚开始使用 vba 和 MS Project。
我正在尝试循环浏览 MS Project 文件中的所有任务,并在某个任务满足特定条件时将其删除。删除任务后会出现问题,似乎 j 任务变量设置为 Nothing,这一切都搞砸了。知道我该怎么做吗?
For Each j In prj.Tasks
If j.Text10 = "1" Or j.Text10 = "2" Then ' If criteria is met
SelectRow Row:=j ' Select the row
EditDelete ' Delete the row
End If
Next j
【问题讨论】:
-
使用 a for x = maxTasks 到 1 step -1 这样你的计数器就不会丢失它的位置
标签: vba ms-project