Task.StartVariance property (Project)

Gets the variance (in minutes) between the baseline start date and the start date of the task. Read-only Variant.

Syntax

expression. StartVariance

expression A variable that represents a Task object.

Example

The following example displays the number of tasks and task names in the active project that have started late.

Sub CountLateTasks() 
 
 Dim t As Task 
 Dim numLateTasks As Long 
 Dim lateTasks As String 
 Dim daysLate As Single 
 
 numLateTasks = 0 
 
 ' Look for late tasks in the active project. 
 For Each t In ActiveProject.Tasks 
 If t.BaselineStart < ActiveProject.CurrentDate And t.StartVariance > 0 Then 
 numLateTasks = numLateTasks + 1 
 daysLate = Round(t.StartVariance / 1440, 1) 
 lateTasks = lateTasks & vbCrLf & vbTab & t.Name _ 
 & ": " & daysLate & " days" 
 End If 
 Next t 
 
 MsgBox "There are " & numLateTasks & " late tasks in this project: " & lateTasks 
 
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.