代表分组定义中的条件。 GroupCriterion 对象是 GroupCriteria 集合的一个成员。
备注
若要使用分组层次结构可以维护且单元格颜色可以为十六进制值的组,请参阅 GroupCriterion2 对象。
示例
使用 GroupCriterion 对象
使用 **GroupCriteria (**Index) (其中Index 是标准索引)返回单个 GroupCriterion 对象。 下面的示例设置第一个条件单元格的颜色为蓝色的标准费率资源组中。
ActiveProject.ResourceGroups("Standard Rate").GroupCriteria(1).CellColor = pjBlue
使用 GroupCriteria 集合
使用 GroupCriteria 属性可以返回一个 GroupCriteria 集合。 以下示例显示在指定任务组中作为准则使用的域的列表,并指定这些域是按升序排序还是按降序排序。
Dim GC As GroupCriterion
Dim Fields As String
For Each GC In ActiveProject.TaskGroups("Priority Keeping Outline Structure").GroupCriteria
If GC.Ascending = True Then
Fields = Fields & GC.Index & ". " & GC.FieldName & " is sorted in ascending order." & vbCrLf
Else
Fields = Fields & GC.Index & ". " & GC.FieldName & " is sorted in descending order." & vbCrLf
End If
Next GC
MsgBox Fields
使用 Add 方法可以将 GroupCriterion 对象添加到 GroupCriteria 集合中。 以下示例将另一准则添加到指定的资源组中,以便按照完成工时的百分比(增量为 25%)确定的升序对资源分组。
ActiveProject.ResourceGroups("Response Pending").GroupCriteria.Add "% Work Complete", True, CellColor:=pjRed, GroupOn:=pjGroupOnPct1_25
方法
名称 |
---|
Delete |
属性
名称 |
---|
Application |
升序 |
Assignment |
CellColor |
FieldName |
FontBold |
FontColor |
FontItalic |
FontName |
FontSize |
FontUnderLine |
GroupInterval |
GroupOn |
索引 |
Parent |
Pattern |
StartAt |
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。