Class WorksheetView (Excel VBA)

An object that defines the behavior of a single worksheet view. To use a WorksheetView class variable it first needs to be instantiated, for example


Dim wsvw as WorksheetView
Set wsvw = ActiveWindow.ActiveSheetView

For Each

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


Dim wsvwSheetView As WorksheetView
For Each wsvwSheetView In Application.SheetViews
	
Next wsvwSheetView

DisplayFormulas

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


ActiveWindow.ActiveSheetView.DisplayFormulas = True

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.


ActiveWindow.ActiveSheetView.DisplayGridlines = True

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.


ActiveWindow.ActiveSheetView.DisplayHeadings = True

DisplayOutline

True if outline symbols are displayed.

This property applies only to worksheets and macro sheets.


ActiveWindow.ActiveSheetView.DisplayOutline = True

DisplayZeros

True if zero values are displayed.

This property applies only to worksheets and macro sheets.


ActiveWindow.ActiveSheetView.DisplayZeros = True

Sheet

Returns the sheet name for the specified WorksheetView object.


Dim strSheet As String
strSheet = ActiveWindow.ActiveSheetView.Sheet