Task.Split Method

Project Developer Reference

Splits a task into portions.

Syntax

expression.Split(StartSplitOn, EndSplitOn)

expression   A variable that represents a Task object.

Parameters

Name Required/Optional Data Type Description
StartSplitOn Required Variant The start date of the task split. If a time is not specified, the project's default end time for the working period is used.
EndSplitOn Required Variant The end date of the task split. If a time is not specified, the project's default start time for the working period is used. If EndSplitOn is on or before the date specified with StartSplitOn, the split is not created.

Example
The following example creates a split in the specified task.

Visual Basic for Applications
  Sub CreateSplit()
    Dim WhichTask As Long
    Dim SplitFrom As Variant, SplitTo As Variant
    
    WhichTask = InputBox("Enter the ID of the task you would like to split:")
    SplitFrom = InputBox("Enter the date and time for the start of the" & _
        " split: " & vbCrLf & vbCrLf & "(The default time is the end" & _
            " time of the preceding working period.)")
    SplitTo = InputBox("Enter the date and time for the end of the split:" & _
        vbCrLf & vbCrLf & "(The default time is the start time of the next" & _
            " working period.)")
    
    ActiveProject.Tasks(WhichTask).Split SplitFrom, SplitTo
    
End Sub

See Also