Returns the largest number of resource units assigned for the assignment. Read-only Variant.
Syntax
expression.Peak
expression A variable that represents an Assignment object.
Return Value
Variant
Example
The following example finds any assignments with more than a certain number of resource units assigned.
Visual Basic for Applications
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