Share via


Window.Caption Property (Excel)

Returns or sets a Variant value that represents the name that appears in the title bar of the document window.

Syntax

expression .Caption

expression A variable that represents a Window object.

Remarks

When you set the name, you can use that name as the index to the Windows collection (as demonstrated in the example.)

Example

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 that window in the Windows collection.

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

See Also

Concepts

Window Object

Window Object Members