Panes Method

Applies To

Window Object.

Description

Accessor. Returns an object that represents one pane (a Pane object, Syntax 1) or a collection of all the panes (a Panes object, Syntax 2) in a window. Read-only.

Syntax 1

object.Panes(index)

Syntax 2

object.Panes

object

Required. The Window object.

index

Required for Syntax 1. The name or number of the pane.

Remarks

This method is only available on a window if its Split property can be set to True.

Example

This example displays the number of panes in the active window in BOOK1.XLS.


Workbooks("BOOK1.XLS").Worksheets("Sheet1").Activate
MsgBox "There are " & ActiveWindow.Panes.Count & _
    " panes in the active window"

This example activates the upper-left pane in the active window in BOOK1.XLS.


Workbooks("BOOK1.XLS").Worksheets("Sheet1").Activate
ActiveWindow.Panes(1).Activate