April 2006
Beginner
1114 pages
98h 16m
English
workbook.Windows [= setting]
Returns the collection of Excel windows in which the workbook is displayed. Use the NewWindow method to open new windows, the Window Close method to close existing windows, and the Windows Arrange method to arrange open windows. If you close the last window displaying a workbook, Excel prompts the user to save any changes before closing.
The following code opens two new windows for the current workbook, arranges them, then closes the three new windows:
ThisWorkbook.NewWindow
ThisWorkbook.NewWindow
ThisWorkbook.Windows.Arrange
If MsgBox("Click OK to close new windows.", vbOKCancel) Then
ThisWorkbook.Windows(3).Close
ThisWorkbook.Windows(2).Close
End If
ThisWorkbook.Windows.ArrangeRead now
Unlock full access