Edit

Share via


Panes object (Excel)

A collection of all the Pane objects shown in the specified window.

Remarks

Pane objects exist only for worksheets and Microsoft Excel 4.0 macro sheets.

Example

Use the Panes property of the Windows object to return the Panes collection.

The following example freezes panes in the active window if the window contains more than one pane.

If ActiveWindow.Panes.Count > 1 Then _ 
 ActiveWindow.FreezePanes = True

Use Panes (index), where index is the pane index number, to return a single Pane object. The following example scrolls through the upper-left pane of the window in which Sheet1 is displayed.

Worksheets("sheet1").Activate 
Windows(1).Panes(1).LargeScroll down:=1

Properties

See also

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.