Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default worksheets scrolling

Can two worksheets be synchronized so that they scroll together? If I
scroll down to line 500 on sheet1 and then switch to sheet2, it too
will be at line 500.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default worksheets scrolling

Not exactly...
'Place this code in the module behind Sheet1.
'--
'Sheet1
Private Sub Worksheet_Deactivate()
On Error GoTo DoRight
If ActiveSheet.Name = "Sheet2" Then
Dim lngRowNum As Long
Application.EnableEvents = False
Me.Activate
lngRowNum = ActiveWindow.VisibleRange.Row
Sheets("Sheet2").Activate
ActiveWindow.ScrollRow = lngRowNum
Application.EnableEvents = True
End If
Exit Sub
DoRight:
Application.EnableEvents = True
End Sub
--
Jim Cone
Portland, Oregon USA



"Fan924"
wrote in message
Can two worksheets be synchronized so that they scroll together? If I
scroll down to line 500 on sheet1 and then switch to sheet2, it too
will be at line 500.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default worksheets scrolling

Hi,

I'm sure there must be a way to get the ScrollRow property of an inactive
sheet and perhaps someone will tell us how. In the meantime try this:-

Alt +F11 to open VB editor, right click 'This Workbook' and insert module
and paste the colde below in.

Sub MySub()
Sheets("Sheet1").Select
ScrollTo = ActiveWindow.ScrollRow
Sheets("Sheet2").Select
ActiveWindow.ScrollRow = ScrollTo
End Sub

Then on the left side double click "Sheet2" and paste this code in

Private Sub Worksheet_Activate()
Application.EnableEvents = False
MySub
Application.EnableEvents = True
End Sub

Close VB editor and whenever sheet 2 is selected it will scroll to the same
row as sheet 1.

Mike

"Fan924" wrote:

Can two worksheets be synchronized so that they scroll together? If I
scroll down to line 500 on sheet1 and then switch to sheet2, it too
will be at line 500.

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
Why are the scrolling buttons between worksheets not working The Mad Tabber Excel Worksheet Functions 2 November 14th 08 07:04 AM
Simultaneous scrolling for 3 worksheets. TomThumb Excel Programming 11 June 5th 08 03:08 PM
Scrolling with two worksheets arranged vertically Richard Champlin Excel Discussion (Misc queries) 4 December 17th 07 03:43 PM
Scrolling all worksheets at the same time Tim Excel Discussion (Misc queries) 1 November 13th 07 05:01 PM
Scrolling through worksheets scott Excel Discussion (Misc queries) 0 August 2nd 06 11:59 PM


All times are GMT +1. The time now is 12:58 AM.

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

About Us

"It's about Microsoft Excel"