Caption Property

Applies To

Application object, AxisTitle object, Characters object, ChartTitle object, DataLabel object, Window object.

Description

Returns text with one of several different meanings, depending on the object type to which it's applied. Read/write String, except as noted in the following table.

Object type

Meaning

Application

The name that appears in the title bar of the main Microsoft Excel window. If you don't set a name, or if you set the name to Empty, this property returns "Microsoft Excel." Read-only on the Macintosh.

AxisTitle

The axis title text.

Characters

The text of this range of characters.

ChartTitle

The chart title text.

DataLabel

The data label text.

Window

The name that appears in the title bar of the document window. When you set the name, you can use that name as the index to the Windows property (see the second example).


See Also

Text property.

Example

This example sets the name that appears in the title bar of the main Microsoft Excel window to be a custom name (this can be done only in Windows; on the Macintosh, the Caption property of the Application object is read-only).

Application.Caption = "Blue Sky Airlines Reservation System"
This example sets the name of the first window in the active workbook to be "Consolidated Balance Sheet." This name is then used as the index to the Windows property.

ActiveWorkbook.Windows(1).Caption = "Consolidated Balance Sheet"
ActiveWorkbook.Windows("Consolidated Balance Sheet") _
    .ActiveSheet.Calculate