Macro to Arrange Open Workbooks

These VBA macros arrange every open workbook on screen at once: tiled, side by side or stacked, so you can compare and copy between files without switching windows.

Works inExcel 2010 and later, Windows and Mac
UndoNot possible. Save a copy first
Save asMacro-Enabled Workbook (.xlsm)

New to macros? See how to use the macros on this site: copy the code, paste it into a module with Alt + F11, and run it with Alt + F8.

Tile every open workbook

Sub TileWorkbooks()
    Windows.Arrange ArrangeStyle:=xlArrangeStyleTiled
End Sub

Side by side or stacked

Sub ArrangeSideBySide()
    Windows.Arrange ArrangeStyle:=xlArrangeStyleVertical
End Sub

Sub ArrangeStacked()
    Windows.Arrange ArrangeStyle:=xlArrangeStyleHorizontal
End Sub

Vertical places the windows next to each other; horizontal stacks them one above the other.

Compare two workbooks, scrolling together

With exactly two workbooks open:

Sub CompareTwoWorkbooks()
    If Workbooks.Count < 2 Then Exit Sub
    Windows.CompareSideBySideWith Windows(2).Caption
    Windows.SyncScrollingSideBySide = True
End Sub

Both windows scroll together, which is handy for checking two versions of a report row by row.

Without a macro

  1. Go to View → Arrange All and choose Tiled, Horizontal, Vertical or Cascade.
  2. For two files, use View → View Side by Side and Synchronous Scrolling.
  3. To see two sheets of the same workbook, use View → New Window first.

Things to know

  • Hidden workbooks, such as your Personal Macro Workbook, aren’t included.
  • In Excel for Microsoft 365, each workbook opens in its own window, so you can also snap them with Windows + ← and Windows + →.

Related macros