【问题标题】:change duration in hidden tasks on MS Project更改 MS Project 上隐藏任务的持续时间
【发布时间】:2013-12-14 02:31:20
【问题描述】:

我是 MS Project 的新手,我需要一些我不知道是否可行的帮助。 在数百个任务的列表中,我需要根据标准隐藏一些。第一步很简单,我已经创建了一个带有我想要的标准的过滤器,将其应用于任务并且效果很好。

问题是我需要更改被过滤器隐藏的任务的持续时间,也就是说,将其持续时间更改为 0,以便影响列表中其他任务的持续时间。通过过滤,唯一要做的就是从视图中隐藏任务,但它们仍然存在,因此日期和持续时间保持不变。

无论如何我可以隐藏任务并将其持续时间设置为 0?也可以通过 VBA,因为我之前使用 VBA,不是在 Project 中,而是在 Access 和 Excel 中。

【问题讨论】:

    标签: vba ms-project


    【解决方案1】:

    如果您有 MS Project 2010 或更高版本,您可以将任务设置为非活动状态(鼠标右键/非活动任务)。这使得持续时间等不再影响其他任务,即使仍然在非活动任务中说明。 否则,像这样的宏应该会有所帮助:

    Dim tskX As Task
    For Each tskX In ActiveProject.Tasks
        If Not (tskX Is Nothing) Then               'Do not combine this line with any other line! You would get runtime errors when accessing empty tasks (space rows) in your schedule.
            If Not tskX.ExternalTask Then           'You can't modify external linked tasks anyhow. You would get runtime errors if trying this.
                If tskX.Text1 = "x" Then            'Instead of "Text1" you can access the field containing your criteria here
                    tskX.PercentWorkComplete = 0
                    tskX.Duration = 0
                    End If
                End If
            End If
        Next tskX
    

    最好的问候,Kawi42

    【讨论】:

    • 谢谢。公司这里使用的版本是 2003,所以这个宏会有所帮助。
    猜你喜欢
    • 2018-12-02
    • 2018-08-29
    • 2021-10-23
    • 1970-01-01
    • 2016-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多