![]() |
Selecting Two Sheets to Display Side by Side
I often want to display two workbooks side by side. I know how to use the
window command and display all teh open workbooks, but this is a pain because I often have numerous workbooks open. I then have to downbar all the ones I don't want to see. Is there a command to display two sheets side by side? I could probably figure out how to write code to let me select the two sheets I want. Maybe someone has already done this. Thanks |
Selecting Two Sheets to Display Side by Side
Give the following macro a try. First, select two worksheets (select first
worksheet, then Ctrl-Click second worksheet's tab); then, run the macro... all workbooks other than the active one will be minimized, the active workbook will be duplicated and tiled, and the two selected sheets will become the active sheet in each displayed window. Sub DisplaySameWorksheetSideBySide() Dim WB As Workbook, FirstSheet As String, SecondSheet As String With ActiveWorkbook.Windows(1) If .SelectedSheets.Count < 2 Then MsgBox "You must select two sheets in this workbook!" Exit Sub End If FirstSheet = .SelectedSheets(1).Name SecondSheet = .SelectedSheets(2).Name End With For Each WB In Workbooks If WB.Name < ActiveWorkbook.Name Then Windows(WB.Name).WindowState = xlMinimized Else Windows(WB.Name).WindowState = xlNormal End If Next ActiveWorkbook.NewWindow Application.Windows.Arrange xlArrangeStyleVertical Windows(ThisWorkbook.Name & ":1").Parent.Worksheets(FirstSheet).Select Windows(ThisWorkbook.Name & ":2").Parent.Worksheets(SecondSheet).Select End Sub -- Rick (MVP - Excel) "mcambrose" wrote in message ... I often want to display two workbooks side by side. I know how to use the window command and display all teh open workbooks, but this is a pain because I often have numerous workbooks open. I then have to downbar all the ones I don't want to see. Is there a command to display two sheets side by side? I could probably figure out how to write code to let me select the two sheets I want. Maybe someone has already done this. Thanks |
All times are GMT +1. The time now is 02:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com