Application.SelectionExtend Method

Project Developer Reference

Turns selection extension on or off.

Syntax

expression.SelectionExtend(Extend, Add)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Extend Optional Boolean True if extend mode is active. (If extend mode is active, all items between the selection and the active item become part of the selection.) If Extend is True, Add is ignored. The default value is False.
Add Optional Boolean True if add mode is active. (If add mode is active, only the active item is added to the selection.) The default value is False.

Return Value
Boolean

Example
The following example adds active item to the selection.

Visual Basic for Applications
  Sub Selection_Extend()
ViewApply Name:="&Gantt Chart"
SelectionExtend Extend:=False, Add:=True

End Sub

See Also