Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ajit Munj
 
Posts: n/a
Default scrolling up & down - ajit

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional sum - Ajit Ajit Munj Excel Discussion (Misc queries) 1 March 4th 05 08:19 AM
format cell for figures - Ajit Ajit Munj Excel Discussion (Misc queries) 3 March 2nd 05 09:44 AM
autofit Column width- Ajit Ajit Munj Excel Discussion (Misc queries) 2 February 24th 05 05:51 PM
How to create a text scrolling window? Rickk New Users to Excel 1 January 29th 05 02:29 AM
Why does my mouse unpredictably start scrolling horizontally? Ken Beedy Excel Discussion (Misc queries) 1 January 18th 05 03:03 PM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"