Windows
Refers to Excel physical structure object which ensures window level customization. Like, Zooming window, Minimize, Maximize etc. In this article we will see what all Window level customization excel offers.
New Window
Opening multiple windows into a workbook provides an easy way to view or work with different areas of your workbook simultaneously. Any changes made in any of the windows are made to the workbook.
You can save multiple windows into a workbook by saving it while multiple windows are open. To remove windows that have been saved with your workbook, close all multiple windows, and then save your document.
Open multiple windows
- Start Microsoft Excel and open any workbook.
- In Microsoft Office Excel 2007, click the View tab, and then click New Window in the Window group.In Microsoft Office Excel 2003 and in earlier versions of Excel, click New Window on the Window menu.
Arrange All
- Under View ribbon locate Window group
- Click Arrange All button
- A popup will appear asking followings:
- Tiled: all windows will be shown tiled (refer figure 1.0)
- Horizontal: all open windows will be shown horizontally (refer figure 1.1)
- Vertical: all open windows will be shown vertically (refer figure 1.2)
- Cascade: all open windows will be shown in cascade manner (refer figure 1.2)
- Windows of active workbook: shows all workbooks as windows if checks to true
- Click OK
Tiled:

Horizontal:

Vertical:

Cascade:

Lets code to automate various windows in Excel. The given examples are created using VSTO (Visual Studio Tool for Office) hence following prerequisites are recommended:
- Visual Studio 2015 or above having Microsoft Office for Developer Tool installed
- Create Excel Addin in C# or VB code style (Visual Studio Tools for Office)
- Excel 2010 or above
- Create a ribbon designer and put button
C# code example
private void btnArrangeAll_Click(object sender, RibbonControlEventArgs e) { //Get active window reference excel.Window oWindow = Globals.ThisAddIn.Application.ActiveWindow; //Create new window oWindow.NewWindow(); //get workbook reference excel.Workbook oWorkbook = Globals.ThisAddIn.Application.ActiveWorkbook; //Arrange tiled oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleTiled); //Arrange horizontal oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleHorizontal); //Arrange vertical oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleVertical); //Arrange Cascade oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleCascade); }
VB.Net code example
Private Sub ArrangeAll_Click(sender As Object, e As RibbonControlEventArgs) Handles ArrangeAll.Click 'Get active window reference Dim oWindow As excel.Window oWindow = Globals.ThisAddIn.Application.ActiveWindow 'Create New window oWindow.NewWindow() 'get workbook reference Dim oWorkbook As excel.Workbook oWorkbook = Globals.ThisAddIn.Application.ActiveWorkbook 'Arrange tiled oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleTiled) 'Arrange horizontal oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleHorizontal) 'Arrange vertical oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleVertical) 'Arrange Cascade oWorkbook.Windows.Arrange(excel.XlArrangeStyle.xlArrangeStyleCascade) End Sub
VBA code example
Private Sub ArrangeAllWindows() 'Get active window reference Dim oWindow As Window Set oWindow = ActiveWindow 'Create New window oWindow.NewWindow 'get workbook reference Dim oWorkbook As Workbook Set oWorkbook = ActiveWorkbook 'Arrange tiled oWorkbook.Windows.Arrange xlArrangeStyleTiled 'Arrange horizontal oWorkbook.Windows.Arrange xlArrangeStyleHorizontal 'Arrange vertical oWorkbook.Windows.Arrange xlArrangeStyleVertical 'Arrange Cascade oWorkbook.Windows.Arrange xlArrangeStyleCascade End Sub
Next >> How to hide, split, unhide workbook in Excel