Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have arranged news.xls with two vertical windows i.e. news1 &
news2. I am comparing two different sheets of the same file. But unlike Lotus, I can not see two rows simultaneously i.e. if I scroll up in sheet1, the same row no. of sheet2 does not scroll up. Thus after one screenful of sheet1, I have to scroll up one screenful of sheet2. Is there any way out to this problem? ajit -- Knowldege is Power |
#2
![]() |
|||
|
|||
![]()
This was added as a built-in feature in xl2003.
(With two windows open, Window|Compare side by side) This kind of macro worked for me in xl2003 if both windows were showing the same worksheet: Option Explicit Sub SyncWindows() Windows.Arrange ActiveWorkbook:=True, _ synchorizontal:=True, syncvertical:=True End Sub But I don't recall how/if it worked in earlier versions of excel. This seemed to mimic the syncing (if you changed selection--not just scrolled). This is a workbook event and goes behind the ThisWorkbook module. Rightclick on the excel icon (to the left of the File option on the worksheet menu bar). Select view code and paste that code into the code window. Option Explicit Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Range) Dim myWindow As Window Dim myMstrWindow As Window If Me.Windows.Count < 2 Then Exit Sub Set myMstrWindow = ActiveWindow With Application .EnableEvents = False .ScreenUpdating = False End With For Each myWindow In Me.Windows If myWindow.Caption = myMstrWindow.Caption Then 'do nothing Else myWindow.ScrollColumn = myMstrWindow.ScrollColumn myWindow.ScrollRow = myMstrWindow.ScrollRow myWindow.Activate ActiveSheet.Range(Target.Address).Select End If Next myWindow myMstrWindow.Activate With Application .EnableEvents = True .ScreenUpdating = True End With End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm You can read more about events at: Chip Pearson's site: http://www.cpearson.com/excel/events.htm David McRitchie's site: http://www.mvps.org/dmcritchie/excel/event.htm Ajit Munj wrote: I have arranged news.xls with two vertical windows i.e. news1 & news2. I am comparing two different sheets of the same file. But unlike Lotus, I can not see two rows simultaneously i.e. if I scroll up in sheet1, the same row no. of sheet2 does not scroll up. Thus after one screenful of sheet1, I have to scroll up one screenful of sheet2. Is there any way out to this problem? ajit -- Knowldege is Power -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional sum - Ajit | Excel Discussion (Misc queries) | |||
format cell for figures - Ajit | Excel Discussion (Misc queries) | |||
autofit Column width- Ajit | Excel Discussion (Misc queries) | |||
How to create a text scrolling window? | New Users to Excel | |||
Why does my mouse unpredictably start scrolling horizontally? | Excel Discussion (Misc queries) |