Skip to content

Latest commit

 

History

History
100 lines (51 loc) · 2.58 KB

Project.groupcriteria2.md

File metadata and controls

100 lines (51 loc) · 2.58 KB
title ms.service ms.assetid ms.date ms.localizationpriority
GroupCriteria2 object (Project)
project-server
ac785cc4-dbe3-0b1d-d1f1-6d45c93bfb1d
06/08/2017
medium

GroupCriteria2 object (Project)

Contains a collection of GroupCriterion2 objects, where the group hierarchy can be maintained and cell color can be a hexadecimal value.

Example

Using the GroupCriterion2 Object

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

ActiveProject.ResourceGroups2("Standard Rate").GroupCriteria2(1).CellColor = &HFF0000

Using the GroupCriteria2 Collection

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

Dim GC2 As GroupCriterion2  
Dim Fields As String  
  
For Each GC2 In ActiveProject.TaskGroups2("Priority Keeping Outline Structure").GroupCriteria  
    If GC2.Ascending = True Then  
       Fields = Fields & GC2.Index & ". " & GC2.FieldName & " is sorted in ascending order." _
           & vbCrLf  
    Else  
        Fields = Fields & GC2.Index & ". " & GC2.FieldName & " is sorted in descending order." _
           & vbCrLf  
    End If  
Next GC2  

MsgBox Fields

Use the AddEx method to add a GroupCriterion2 object to the GroupCriteria2 collection, where CellColor can be a hexadecimal value. 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-percent increments) that is complete.

ActiveProject.ResourceGroups2("Response Pending").GroupCriteria2.AddEx "% Work Complete", True, _  
    CellColor:=&H0101FF, GroupOn:=pjGroupOnPct1_25

Methods

Name
Add
AddEx

Properties

Name
Application
Count
Item
Parent

See also

Project Object Model

[!includeSupport and feedback]