Class WorksheetView (Excel VBA)

An object that defines the behavior of a single worksheet view.

Set

To use a WorksheetView class variable it first needs to be instantiated, for example

Dim lngIndex As Long: lngIndex = 
Dim wnd As Window: Set wnd = 
Dim wsvwSheetView As WorksheetView
Set wsvwSheetView = wnd.SheetViews(Index:=lngIndex)

The following procedures can be used to set variables of type WorksheetView: Window.SheetViews, SheetViews.Item, SheetViews.Item and Window.ActiveSheetView

For Each

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

Dim wnd As Window: Set wnd = 
Dim wsvwSheetView As WorksheetView
For Each wsvwSheetView In wnd.SheetViews
	
Next wsvwSheetView

SheetViews.Count

Returns the number of objects in the collection.

SheetViews.Item

Returns a SheetView object that represents views in a workbook.

Syntax : expression.Item (Index)

Index: Index value of the view.

SheetViews.Parent

Returns the parent object for the specified object. Read-only.

DisplayFormulas

Returns or sets if formulas should be displayed or hidden in the current worksheet view.

DisplayGridlines

True if gridlines are displayed.

This property applies only to worksheets and macro sheets. This property affects only displayed gridlines. Use the PrintGridlines property to control the printing of gridlines.

DisplayHeadings

True if both row and column headings are displayed; False if no headings are displayed.

This property applies only to worksheets and macro sheets. This property affects only displayed headings. Use the PrintHeadings property to control the printing of headings.

DisplayOutline

True if outline symbols are displayed.

This property applies only to worksheets and macro sheets.

DisplayZeros

True if zero values are displayed.

This property applies only to worksheets and macro sheets.

Parent

Returns the parent object for the specified object. Read-only.

Sheet

Returns the sheet name for the specified WorksheetView object.