Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming:
Dim srcProgramSummaryWs As Worksheet Set srcProgramSummaryWs = Sheets("ProgramSummary") In the Private Sub Worksheet_Activate() can you immediately set the ActiveWindow.ScrollRow to be the same as that of the srcProgramSummaryWs (+8 rows)? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I put this in a general module:
Option Explicit Public ProgramSummaryRowNumber As Long I put this behind the programsummary worksheet: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) ProgramSummaryRowNumber = ActiveWindow.ScrollRow End Sub I put this behind the unnamed sheet: Option Explicit Private Sub Worksheet_Activate() If ProgramSummaryRowNumber 0 Then ActiveWindow.ScrollRow = ProgramSummaryRowNumber + 8 End If End Sub If I went to the programsummary worksheet first, selected a different cell, then went to the other sheet, it worked fine. CRayF wrote: Assuming: Dim srcProgramSummaryWs As Worksheet Set srcProgramSummaryWs = Sheets("ProgramSummary") In the Private Sub Worksheet_Activate() can you immediately set the ActiveWindow.ScrollRow to be the same as that of the srcProgramSummaryWs (+8 rows)? -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I receive "Variable Not Defined"...
I guess I'm still not quite got down where global variables go... In the "Modules" folder (right below "Forms") I placed the 2 lines below in a Module of it's own (Module1): --------------- Option Explicit Public ProgramSummaryRowNumber As Long ---------------- And In the "ProgramSummary Worksheet" code I placed above any SUB() statement: Option Explicit And added within the existing "Sub Worksheet_SelectionChange" I added: ProgramSummaryRowNumber = ActiveWindow.ScrollRow -------------------------------------------- Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error GoTo ws_exit Application.EnableEvents = False ProgramSummaryRowNumber = ActiveWindow.ScrollRow 'Set Current Row Number '------- Set Variables to Workbook Names --------------- Dim srcProgramDataInputWs As Worksheet Dim srcProgramSummaryTemplateWs As Worksheet Dim srcProgramSummaryWs As Worksheet ...more... ----------------------------------- |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry... User Error... (Syntax)
Works fine... thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, Now that I have the Syntax right, here are the symptoms...
This all works but I have to click on a cell to have it record... If I simply scroll the "Program Summary Worksheet" where I want, and then go to the corresponding Worksheet, I hope to end up on the matching row number of the "Program Summary Worksheet" I just left. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could put the same code into the worksheet_activate routine:
This is behind the programsummary sheet: Option Explicit Private Sub Worksheet_Activate() ProgramSummaryRowNumber = ActiveWindow.ScrollRow End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) ProgramSummaryRowNumber = ActiveWindow.ScrollRow End Sub CRayF wrote: OK, Now that I have the Syntax right, here are the symptoms... This all works but I have to click on a cell to have it record... If I simply scroll the "Program Summary Worksheet" where I want, and then go to the corresponding Worksheet, I hope to end up on the matching row number of the "Program Summary Worksheet" I just left. -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That doesn't seem to work either.
I go to the "Program Summary" Ws, (I've set up a few Target.Address = "$c$r" 's to move aound). I use these Target.Address's to scoll down a few races... and when I go to the Betting Workseet, it does not move up or down. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't understand what you mean by target.address to scroll down.
But it did work for me in my tests. CRayF wrote: That doesn't seem to work either. I go to the "Program Summary" Ws, (I've set up a few Target.Address = "$c$r" 's to move aound). I use these Target.Address's to scoll down a few races... and when I go to the Betting Workseet, it does not move up or down. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting up a worksheet | Excel Worksheet Functions | |||
Setting up Excel worksheet | Setting up and Configuration of Excel | |||
Setting up a worksheet for LOG LOG analysis | Excel Worksheet Functions | |||
Setting Worksheet Name | Excel Programming | |||
setting tab name for worksheet | Excel Programming |