Share via


Window.Caption Property

Excel Developer Reference

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 property (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 the Windows property.

Visual Basic for Applications
  ActiveWorkbook.Windows(1).Caption = "Consolidated Balance Sheet"
ActiveWorkbook.Windows("Consolidated Balance Sheet") _
    .ActiveSheet.Calculate

See Also