ResourceGroups2 object (Project)

Represents all of the resource-based group definitions, where group hierarchy can be maintained. ResourceGroups2 is a collection of Group2 objects.

Example

Using the ResourceGroups2 Collection

Use the ResourceGroups2 property to return a ResourceGroups2 collection. The following example lists the names of all the resource groups in the active project.

Dim rg2 As Group2  
Dim rGroups2 As String  
  
For Each rg2 in ActiveProject.ResourceGroups2  
    rGroups2 = rGroups2 & rg2.Name & vbCrLf  
Next rg2  
  
MsgBox rGroups2

Use the Add method to add a Group2 object to the ResourceGroups2 collection. The following example creates a new group that groups resources by their standard rate and then modifies the criterion so that the resources are sorted in descending order.

ActiveProject.ResourceGroups2.Add "Resources by Rate", "Standard Rate"  
ActiveProject.ResourceGroups2("Resources by Rate").GroupCriteria(1).Ascending = False

Methods

Name
Add
Copy

Properties

Name
Application
Count
Item
Parent

See also

Project Object Model

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.