Caption Property

Caption property as it applies to the ChSeries, ChTitle, ChTrendline, Heading, Spreadsheet, PivotField, PivotFieldSet, PivotLabel, PivotMemberProperty, PivotTotal, and TitleBar objects.

Returns or sets the caption for the specified object. Read/write String.

expression.Caption

*expression   * Required. An expression that returns one of the objects listed above.

Caption property as it applies to the ChCategoryLabel, PivotAxisMember, PivotColumnMember, PivotMember, PivotPageMember, PivotResultMemberProperty, and PivotRowMember objects.

Returns the caption for the specified object. Read-only String.

expression.Caption

*expression   * Required. An expression that returns one of the objects listed above.

Example

As it applies to the Spreadsheet object

This example displays the current date and time in the title bar of Spreadsheet1.

Sub SetTitleBar_Caption()
    Dim ssTitle
    
    Set ssTitle = Spreadhseet1.TitleBar
    
    ' Set the title bar's caption to the 
    ' current date and time.
    ssTitle.Caption = Date & " " & Time
    
    ' Enable the title bar.
    ssTitle.Visible = True
End Sub

Applies to | ChCategoryLabel Object | ChSeries Object | ChTitle Object | ChTrendline Object | Heading Object | PivotAxisMember Object | PivotColumnMember Object | PivotField Object | PivotFieldSet Object | PivotLabel Object | PivotMember Object | PivotMemberProperty Object | PivotPageMember Object | PivotResultMemberProperty Object | PivotRowMember Object | PivotTotal Object | Spreadsheet Object | TitleBar Object

See Also | BaseName Property