Class Panes (Excel VBA)

A collection of all the Pane objects shown in the specified window. To use a Panes class variable it first needs to be instantiated, for example


Dim pns as Panes
Set pns = ActiveWindow.Panes

For Each

Here is an example of processing the Panes items in a collection.


Dim pan As Pane
For Each pan In Application.Panes
	
Next pan

Count

Returns a Long value that represents the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveWindow.Panes.Count

Item

Returns a single object from a collection.

Item (Index)

Index: The index number of the object.


Dim panItem As Pane
Set panItem = ActiveWindow.Panes(Index:=1)