Goto Method

Applies To

Application Object.

Description

Selects any range or Visual Basic procedure in any workbook, and activates that workbook if it is not already active.

Syntax

object.Goto(reference, scroll)

object

Required. The Application object.

reference

Optional. Specifies the destination. Can be a Range object, a string containing a cell reference in R1C1 notation, or a string containing a Visual Basic procedure name. If this argument is omitted, the destination is the last range you used the Goto method to select.

scroll

Optional. If this argument is True, Microsoft Excel scrolls the window so that the top left corner of the range appears in the top left corner of the window. If False or omitted, Microsoft Excel does not scroll the window.

Remarks

This method differs from the Select method in the following ways.

See Also

Select Method.

Example

This example selects cell A154 on Sheet1 and then scrolls through the worksheet to display the range.


Application.Goto reference:=Worksheets("Sheet1").Range("A154"), _
    scroll:=True