Class SheetViews (Excel VBA)

A collection of all the sheet views in the specified or active workbook window. To use a SheetViews class variable it first needs to be instantiated, for example


Dim svs as SheetViews
Set svs = ActiveWindow.SheetViews

For Each

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


Dim chrvwSheetView As ChartView
For Each chrvwSheetView In ActiveWindow.SheetViews
	
Next chrvwSheetView

Count

Returns the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveWindow.SheetViews.Count

Item

Returns a SheetView object that represents views in a workbook.

Item (Index)

Index: Index value of the view.


Dim chrvwItem As ChartView
Set chrvwItem = ActiveWindow.SheetViews(Index:=1)

Count

Returns the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveWindow.SheetViews.Count

Item

Returns a SheetView object that represents views in a workbook.

Item (Index)

Index: Index value of the view.


Dim chrvwItem As ChartView
Set chrvwItem = ActiveWindow.SheetViews(Index:=1)