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

I want to compare two or more worksheets or charts. When
they are display the on screen, I'd like to be able scroll
in one active sheet and have the other sheet windows
scrolling synchronistically. The problem is there is no
worksheet/workbook/application event for capturing this
scrolling action.

Can anybody help with some ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Capture scrolling event

Allen,

Interesting question. I use a program called TextPad for editing text files
and it has a similar feature where you can scroll two files side-by-side.
Very useful for debugging ASP and HTML code files.

In Excel, there isn't a Scrolling event but here is an example of how to
coordinate ActiveCell movements by using the Worksheet_ SelectionChange
event. Place the code in the Sheet code pane (not a standard Module code
pane) of the worksheet that is the master or driver. I hard coded the
workbooks as 1 and 2. You may need to change this for your situation. In
this example, Workbooks(1) drives Workbooks(2).

As you probably know, you can use the Window | Arrange... (Vertical) command
from the menubar to tile the two workbooks next to each other.

'''====== This code works for two workbooks.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim sRng As String
Dim lngTLRow As Long
Dim lngTLCol As Long

sRng = Target.Address
lngTLRow = ActiveWindow.ScrollRow
lngTLCol = ActiveWindow.ScrollColumn

Application.ScreenUpdating = False
With Workbooks(2)
.Activate
ActiveWindow.ScrollRow = lngTLRow
ActiveWindow.ScrollColumn = lngTLCol
.ActiveSheet.Range(sRng).Select
End With
Workbooks(1).Activate
Application.ScreenUpdating = True
End Sub

================================================== ==================

For the situation where you want to compare two worksheets in a single
workbook. Use the Window | New Window command to create a second window of
the single workbook. Then use the Window | Arrange command to tile the
windows vertically. Select the second sheet in the second window. Place the
code below in the worksheet code pane that is the driver. You may need to
switch the 1 and 2 indexes or use a name in the Window objects below for
your situation. Be careful, I think I saw the second window created is
indexed as Windows(1) and the original window is Windows(2).

'''====== This code works for two sheets in the same workbook in two window
panes.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim sRng As String
Dim lngTLRow As Long
Dim lngTLCol As Long

sRng = Target.Address
lngTLRow = ActiveWindow.ScrollRow
lngTLCol = ActiveWindow.ScrollColumn

Application.ScreenUpdating = False
With ActiveWorkbook.Windows(2)
.Activate
ActiveWindow.ScrollRow = lngTLRow
ActiveWindow.ScrollColumn = lngTLCol
.ActiveSheet.Range(sRng).Select
End With
ActiveWorkbook.Windows(1).Activate
Application.ScreenUpdating = True
End Sub


Hopefully this gets you started.

Troy


"Allen" wrote in message
...
I want to compare two or more worksheets or charts. When
they are display the on screen, I'd like to be able scroll
in one active sheet and have the other sheet windows
scrolling synchronistically. The problem is there is no
worksheet/workbook/application event for capturing this
scrolling action.

Can anybody help with some ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Capture scrolling event

Jim Rech posted this:

http://groups.google.com/groups?selm...%40cppssbbsa03

It may do what you want (well, if you change it to Trues).

And I think that I've seen posts that this is built into xl2003. (but not sure)

Allen wrote:

I want to compare two or more worksheets or charts. When
they are display the on screen, I'd like to be able scroll
in one active sheet and have the other sheet windows
scrolling synchronistically. The problem is there is no
worksheet/workbook/application event for capturing this
scrolling action.

Can anybody help with some ideas?


--

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
Capture the hyperlink event before it goes to the link Korekiyo Baisotei Excel Discussion (Misc queries) 0 September 25th 08 05:53 AM
Excel screen capture to capture cells and row and column headings jayray Excel Discussion (Misc queries) 5 November 2nd 07 11:01 PM
Capture event when exit Column G zSplash Excel Discussion (Misc queries) 2 December 27th 04 05:28 PM
capture paste event into a cell No Name Excel Programming 3 January 30th 04 07:24 PM
VBA capture File SaveAs Event Linda Mcfarlane Excel Programming 2 September 17th 03 04:06 AM


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

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"