GroupCriterion Object, GroupCriteria Collection Object

Group
GroupCriteria
GroupCriterion

Represents a criterion in a group definition. The GroupCriterion object is a member of the GroupCriteria collection.

Using the GroupCriterion Object

Use GroupCriteria(Index), where Index is the criterion index, to return a single GroupCriterion object. The following example sets the cell color for the first criterion in the Standard Rate resource group to blue.

ActiveProject.ResourceGroups("Standard Rate").GroupCriteria(1).CellColor = pjBlue

Using the GroupCriteria Collection

Use the GroupCriteria property to return a GroupCriteria collection. The following example displays a list of the fields used as criteria in the specified task group and whether they are sorted in ascending or descending order.

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

Use the Add method to add a GroupCriterion object to the GroupCriteria collection. The following example adds another criterion to the specified resource group, grouping resources in ascending order as determined by the percentage of their work (in 25% increments) that is complete.

ActiveProject.ResourceGroups("Response Pending").GroupCriteria.Add "% Work Complete", True, CellColor:=pjRed, GroupOn:=pjGroupOnPct1_25

Properties | Application Property | Ascending Property | Assignment Property | CellColor Property | Count Property | FieldName Property | FontBold Property | FontColor Property | FontItalic Property | FontName Property | FontSize Property | FontUnderline Property | GroupInterval Property | GroupOn Property | Index Property | Item Property | Parent Property | Pattern Property | StartAt Property

Methods | Add Method | Delete Method

Parent Objects | Group Object, Groups Collection Object

See Also | GroupCriteria Property