ViewableRange Property

Microsoft Office Web Components Visual Basic

Returns or sets the range of cells that the user can view. This makes it possible to hide worksheet cells (that contain intermediate calculations, for example). Read/write String.

expression.ViewableRange

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

Do not confuse this property with the VisibleRange property, which returns a Range object that represents all the cells that are currently visible.

Example

This example sets the viewable range on the spreadsheet.

Sub Shrink_Viewable_Range()

    ' Set the viewable range of the window to cells A1:D10.
    Spreadsheet1.ActiveWindow.ViewableRange = "A1:D10"
    
    ' Resize the spreadsheet to eliminate the gray area.
    Spreadsheet1.Autofit = True
End Sub