Share via


Resource.OvertimeRate property (Project)

Dient zum Abrufen oder festlegen den Überstundensatz einer Ressource. Variant mit Lese-/Schreibzugriff.

Syntax

Ausdruck. OvertimeRate

Ausdruck Eine Variable, die ein Resource-Objekt darstellt.

HinwBemerkungeneise

Die OvertimeRate -Eigenschaft gibt nicht für Ressourcen der Art Material sinnvollen Informationen zurück. Festlegen eines Werts wird ein auffangbarer Fehler (Fehlercode 1101) Wenn Sie auf Ressourcen der Art Material angewendet.

Beispiel

Im folgenden Beispiel wird der aktuelle Überstundensatz aller Ressourcen des aktiven Projekts auf das 1,5-fache des Standardsatzes festgelegt.

Sub SetOverTimeRate() 
 
 Dim R As Resource ' Resource object used in For Each loop 
 Dim StdRate As Double ' Numeric value of resource's standard rate 
 Dim Count As Integer ' Counter used in For Next loop 
 Dim FirstNumber As Integer ' Position of the first number 
 
 For Each R In ActiveProject.Resources 
 ' Find the first character that is a number 
 For Count = 1 To Len(R.StandardRate) 
 If IsNumeric(Mid(R.StandardRate, Count, 1)) Then 
 FirstNumber = Count - 1 
 Exit For 
 End If 
 Next Count 
 
 ' Strip off any leading currency symbol and then use the 
 ' Val function to ignore any characters that follow the number 
 StdRate = Val(Right$(R.StandardRate, Len(R.StandardRate) - FirstNumber)) 
 
 ' Set the overtime rate 
 R.OvertimeRate = 1.5 * StdRate 
 Next R 
 
End Sub

Support und Feedback

Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.