Visible Property

Applies To

Application Object, Arc Object, Arcs Collection, Button Object, Buttons Collection, Chart Object, ChartObject Object, ChartObjects Collection, Charts Collection, CheckBox Object, DialogSheet Object, DialogSheets Collection, Drawing Object, DrawingObjects Collection, Drawings Collection, DropDown Object, DropDowns Collection, EditBox Object, EditBoxes Collection, GroupBox Object, GroupBoxes Collection, GroupObject Object, GroupObjects Collection, Label Object, Labels Collection, Line Object, Lines Collection, ListBox Object, ListBoxes Collection, Module Object, Modules Collection, Name Object, OLEObject Object, OLEObjects Collection, OptionButton Object, OptionButtons Collection, Oval Object, Ovals Collection, Picture Object, Pictures Collection, PivotItem Object, Rectangle Object, Rectangles Collection, ScrollBar Object, ScrollBars Collection, Sheets Collection, Spinner Object, Spinners Collection, TextBox Object, TextBoxes Collection, Toolbar Object, Window Object, Worksheet Object, Worksheets Collection.

Description

True if the object is visible. For a chart, dialog sheet, module or worksheet, this property can be set to xlVeryHidden. This hides the object so that it can only be made visible by setting this property to True (the user cannot make the object visible). Read-write.

Remarks

The Visible property for a pivot item is True if the item is currently showing on the table.

If you set the Visible property for a name to False, the name will not 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()"