Application.SelectRange method (Project)
Selects one or more cells.
expression A variable that represents an Application object.
|Row||Required||Long||The number of the row containing the cell to select.|
|Column||Required||Integer||The number of the column containing the cell to select. (Columns are numbered from left to right, starting with 2.)|
|RowRelative||Optional||Boolean||True if the location of the new selection is relative to the active selection. The default value is True.|
|Width||Optional||Long||The number of columns to select in addition to the active cell.|
|Height||Optional||Long||The number of rows to select in addition to the active cell.|
|Extend||Optional||Boolean||True if the active selection is extended into the new selection. The default value is False.|
|Add||Optional||Boolean||True if the new selection is added to the active selection. The default value is False.|
The following example selects columns 3 through 6 and rows 4 through 6 on the Gantt Chart.
Sub Select_Range() ViewApply Name:="&Gantt Chart" SelectRange Row:=4, Column:=3, RowRelative:=False, Width:=3, Height:=2 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.