OK ... you asked for it!
Start Project
Open your project file
Alt+F11 to open the VBA window
In the VBA windown on the left side, you'll see your project name; click once on it.
In the VBA window on the menu bar, click on Insert | Module
Watch for line wraps in the text that follows.
Sub PDQBach1()
Dim tsk As Task
Dim assgn As Assignment
Dim res As Resource
Dim strMsgBox As String
Dim strGroup As String
Dim strSp As String
Dim lngWork() As Long
Dim lngWorkIndex As Long
Dim lngLength As Long
Dim resID As Long
'Find the longest Group name
lngLength = 0
For Each res In ActiveProject.Resources
If Not res Is Nothing Then
If Len(res.Group) > lngLength Then
lngLength = Len(res.Group)
End If
End If
Next
'Initialize some fields
strSp = Space(lngLength)
lngLength = lngLength + 1
'jb strGroup = "/" & strSp
'Build string with all Group names
For Each res In ActiveProject.Resources
If Not res Is Nothing Then
If InStr(1, strGroup, "/" & res.Group) = 0 Then
strGroup = strGroup & Left("/" & res.Group & strSp, lngLength)
End If
End If
Next
lngWorkIndex = Len(strGroup) / lngLength
ReDim lngWork(lngWorkIndex)
'Loop through project getting each task
' (A task can have 0 or more assignments)
' Loop through the task getting each assignment
' Find the resource assigned
' Find the Group name for the resource
' Look it up in the string with all group names (and fiddle to get an integer)
' Add the work (which is in minutes) to the array total
' End loop of each assignment
'End loop of each task
For Each tsk In ActiveProject.Tasks
If Not tsk Is Nothing Then
If tsk.Assignments.Count > 0 Then
For Each assgn In tsk.Assignments
resID = assgn.ResourceID
lngWorkIndex = ((InStr(1, strGroup, "/" & ActiveProject.Resources(resID).Group) - 1) / lngLength)
lngWork(lngWorkIndex) = lngWork(lngWorkIndex) + assgn.Work
Next
End If
End If
Next
'Prepare msgbox display
strGroup = Replace(strGroup, " ", "_")
strMsgBox = ""
lngWorkIndex = Len(strGroup) / lngLength
For i = 0 To lngWorkIndex - 1
strMsgBox = strMsgBox & Mid(strGroup, (lngLength * i) + 2, lngLength - 1) _
& vbTab _
& lngWork(i) / (ActiveProject.HoursPerDay * 60) _
& vbCrLf
Next
MsgBox strMsgBox, vbOKOnly, "Resource Group and Work Days"
End Sub
Pick up all that text and paste it into the module you just opened.
Close the VBA window (click on the X in the upper right corner) -- don't worry about saving, that happens next.
Save the project file (saves the project and the macro)
Alt+F8 to open the list of macros.
Look for PDQBach1
Double-click on it. You'll get a msgbox showing each group and the number of work days in the group.
You can compare those numbers with the results produced by my earlier message. In my tests, they matched (occasionally off in the 2nd or 3rd decimal position because of rounding by Project).
Hope this is what you wanted.