Window.Top property (Excel)

Returns or sets a Double value that represents the distance, in points, from the top edge of the window to the top edge of the usable area (below the menus, any toolbars docked at the top, and the formula bar).

Syntax

expression.Top

expression A variable that represents a Window object.

Remarks

You cannot set this property for a maximized window. Use the WindowState property to return or set the state of the window.

Example

This example arranges windows one and two horizontally; in other words, each window occupies half the available vertical space and all the available horizontal space in the application window's client area. For this example to work, there must be only two worksheet windows open.

Windows.Arrange xlArrangeTiled 
ah = Windows(1).Height ' available height 
aw = Windows(1).Width + Windows(2).Width ' available width 
With Windows(1) 
 .Width = aw 
 .Height = ah / 2 
 .Left = 0 
End With 
With Windows(2) 
 .Width = aw 
 .Height = ah / 2 
 .Top = ah / 2 
 .Left = 0 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.