Simultaneous scrolling for 3 worksheets.
Ken, Thank you for giving me your code and directions for implementing it.
I really appreciate that you spent your time on my problem. I did, however,
have a different scenario in mind. I don't want a toolbar the user has to
remember to use, but rather that when the user has spreadsheet A open and
then clicks on the tab for spreadsheets B or C, they are viewing the same
scrollrow as spreadsheet A. It would even be nicer if changes to the
scrollrow of spreadsheets B or C would be reflected in A. I want the user to
do nothing special, except click on spreadsheets A, B, or C, to achieve
synchrony.
--
TomThumb
"Ken Johnson" wrote:
On Apr 23, 7:52 am, TomThumb
wrote:
It would be a real convenience for me to be able to scroll to row 159 of
spreadsheet A and then when I click on spreadsheet B or C, the scroll row is
preset to 159 on those worksheets. Any help would be greatly appreciated.
--
TomThumb
One way...
Assign these two macros to suitably captioned buttons (eg "Goto B" and
"Goto C") on a new toolbar named "Sync Scroll Row"...
Public Sub SyncToB()
Dim AScrollRow As Long
AScrollRow = ActiveWindow.ScrollRow
Worksheets("B").Activate
ActiveWindow.ScrollRow = AScrollRow
End Sub
Public Sub SyncToC()
Dim AScrollRow As Long
AScrollRow = ActiveWindow.ScrollRow
Worksheets("C").Activate
ActiveWindow.ScrollRow = AScrollRow
End Sub
Add these two Event Procedures to worksheet A...
Private Sub Worksheet_Activate()
Application.CommandBars("Sync Scroll Row").Visible = True
End Sub
Private Sub Worksheet_Deactivate()
Application.CommandBars("Sync Scroll Row").Visible = False
End Sub
The Sync Scroll Row toolbar will then only be visible in Worksheet A.
Use the toolbar to get to worksheets B and C with the same scroll row
as worksheet A.
First add the SyncToB and SyncToC macros to a general code module.
Then use go View|Toolbars|Customise... and use the Customise dialog to
make the Sync Scroll Row toolbar. Then add the Event Procedures to the
Worksheet A code module.
Ken Johnson
|