ChDataLabel, ChLegendEntry, PivotLabel, and TitleBar objects: Returns or sets a Boolean that determines whether the specified object is visible. Set this property to False to hide the specified object. Read/write.
Sheets and Worksheets objects: Returns or sets a Variant that determines whether the specified object is visible. Set this property to False to hide the specified object. Read/write.
Window object. Returns a Boolean that indicates whether the specified window is visible. Read-only.
Worksheet object. Returns or sets a XlSheetVisibility constant that determines the visibility of the specified worksheet. Read/write.
XlSheetVisibility can be one of these XlSheetVisibility constants. |
xlSheetHidden |
xlSheetVeryHidden |
xlSheetVisible |
expression.Visible
expression Required. An expression that returns one of the objects in the Applies To list.
This example displays the legend for the specified chart and hides the specified legend entry.
Sub ShowLegend()
ChartSpace1.Charts(0).HasLegend = True
ChartSpace1.Charts(0).Legend.LegendEntries(1).Visible = False
End Sub