Setting Row to be = to another Worksheet?
Just using the scrollbars doesn't fire anything within excel. So there's no
macro that can run.
I guess you could use the worksheet_activate event to go back to your first
worksheet, check the top row number, then come back to the second worksheet and
use that.
This goes behind the "betting ws" worksheet
Option Explicit
Private Sub Worksheet_Activate()
Dim myTopRow As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Worksheets("Program Summary").Activate
myTopRow = ActiveWindow.ScrollRow
Me.Activate
ActiveWindow.ScrollRow = myTopRow
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
=======
And you can dump that other code.
CRayF wrote:
I have 2 Worksheets. €śProgram Summary Worksheet€ť & €śBetting Worksheet€ť. Each
of them hold race data. Each race is 12 rows long.
When I am on the €śProgram Summary Ws€ť and say I move from Race 2 down to
Race 8€¦ (Row 87) and then switch back to the €śBetting Ws€ť I am wanting to
have the €śBetting Ws€ť automatically scroll down to the same row number (+8)
as the €śProgram Summary.
The code you provided above did this. So I think that much was understood.
The problem is that if I move to the €śProgram Summary Ws€ť and use the mouse
to scroll down to say Race 10 (Row 111) the variable is not updated because a
€śchange€ť does not appear to have occurred.
My including of the €śtarget.address€ť code from the €śProgram Summary Ws€ť was
to show that I had also set up where I can click on a cell and it brings that
cell to the top of the screen. That also does not update the variable.
The only time the variable gets updates is if I then click on something from
the €śProgram Summary Ws€ť.
I was hoping to acquire the top Row number of the €śProgram Summary€ť even if
I use the mouse to scroll down. (I know Excel remembers this €“ as my default,
it returns to where I left off when returning back to the Ws.
Does thing help?
--
Dave Peterson
|