Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Setting Row to be = to another Worksheet?

Sorry... User Error... (Syntax)
Works fine... thanks
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Setting Row to be = to another Worksheet?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Setting Row to be = to another Worksheet?

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
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
Setting up a worksheet Setting a Mileage Expense Report Excel Worksheet Functions 1 November 14th 07 07:44 PM
Setting up Excel worksheet Lee H. Setting up and Configuration of Excel 2 April 15th 07 01:18 PM
Setting up a worksheet for LOG LOG analysis David Stamm Excel Worksheet Functions 1 September 14th 06 07:39 PM
Setting Worksheet Name Nigel Bennett Excel Programming 4 May 7th 05 06:16 PM
setting tab name for worksheet Jan Eikeland Excel Programming 4 December 11th 03 08:45 PM


All times are GMT +1. The time now is 05:33 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"