Assignment.Peak property (Project)

Gets the largest number of resource units for the assignment. Read-only Variant.

Syntax

expression. Peak

expression A variable that represents an Assignment object.

Example

The following example finds any assignments with more than a certain number of resource units assigned.

Sub FindOverassigned() 
 Dim T As Task, A As Assignment 
 Dim TooMany As Double, Results As String 
 
 TooMany = InputBox("Enter maximum allowed units per assignment: ") 
 
 For Each T In ActiveProject.Tasks 
 If Not (T Is Nothing) Then 
 For Each A In T.Assignments 
 If A.Peak > TooMany Then 
 Results = Results & T.Name & ": " & A.ResourceName & vbCrLf 
 End If 
 Next A 
 If Results <> "" Then MsgBox "The following resources are " & _ 
 "assigned more than " & TooMany & " units:" & vbCrLf & Results 
 Results = "" 
 End If 
 Next T 
 
End Sub

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.