Visible Property

Applies To

Application object, Chart object, ChartFillFormat object, ChartObject object, ChartObjects collection object, Charts collection object, Comment object, FillFormat object, LineFormat object, Name object, OLEObject object, OLEObjects collection object, Phonetic object, PivotItem object, ShadowFormat object, Shape object, ShapeRange collection object, Sheets collection object, ThreeDFormat object, Window object, Worksheet object, Worksheets collection object.

Description

True if the object is visible. For a chart or worksheet, this property can be set to xlVeryHidden. This hides the object so that the only way for you to make it visible again is by setting this property to True (the user cannot make the object visible). Read/write Boolean or Long.

Remarks

The Visible property for a pivot item is True if the item is currently visible in the table.

If you set the Visible property for a name to False, the name won't appear in the Define Name dialog box.

Example

This example hides Sheet1.

Worksheets("Sheet1").Visible = False
This example makes Sheet1 visible.

Worksheets("Sheet1").Visible = True
This example makes every sheet in the active workbook visible.

For Each sh In Sheets
    sh.Visible = True
Next sh
This example creates a new worksheet and then sets its Visible property to xlVeryHidden. To refer to the sheet, use its object variable, newSheet, as shown in the last line of the example. To use the newSheet object variable in another procedure, you must declare it as a public variable (Public newSheet As Object) in the first line of the module preceding any Sub or Function procedure.

Set newSheet = Worksheets.Add
newSheet.Visible = xlVeryHidden
newSheet.Range("A1:D4").Formula = "=RAND()"