Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using Excel 2002. Is there a way to toggle between 2 sheets pointing on
the same row number? Example: Sheet1 R1C1, when I select Sheet2 cursor points to the same address R1C1. Thanks in advance, -- rcruz |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You should be able to use this worksheet event code...
Private Sub Workbook_SheetActivate(ByVal Sh As Object) If Sh.Name = "Sheet1" Or Sh.Name = "Sheet2" Then Sh.Range("A1").Select End Sub Note: I don't have XL2002, rather I have XL2003; but I think the above should work for either version. -- Rick (MVP - Excel) "jrcruzr" wrote in message ... I'm using Excel 2002. Is there a way to toggle between 2 sheets pointing on the same row number? Example: Sheet1 R1C1, when I select Sheet2 cursor points to the same address R1C1. Thanks in advance, -- rcruz |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want to take the cursor to current row when you change sheet then you
need this: Declare the variable in an ordinary module : Public ActiveRow As Long Place this in the codesheet for Sheet1 and Sheet2: Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveRow = ActiveCell.Row End Sub Place this in the codesheet for ThisWorkbook: Private Sub Workbook_SheetActivate(ByVal Sh As Object) If Sh.Name = "Sheet1" Or Sh.Name = "Sheet2" Then Cells(ActiveRow, 1).Select End If End Sub --- Per "jrcruzr" skrev i meddelelsen ... I'm using Excel 2002. Is there a way to toggle between 2 sheets pointing on the same row number? Example: Sheet1 R1C1, when I select Sheet2 cursor points to the same address R1C1. Thanks in advance, -- rcruz |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Open the ThisWorkbook module and enter the following code:
Private LastAddr As String Private Sub Workbook_SheetActivate(ByVal Sh As Object) On Error Resume Next Sh.Range(LastAddr).Select End Sub Private Sub Workbook_SheetSelectionChange( _ ByVal Sh As Object, ByVal Target As Range) LastAddr = Target.Address End Sub Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Mon, 16 Mar 2009 12:31:01 -0700, jrcruzr wrote: I'm using Excel 2002. Is there a way to toggle between 2 sheets pointing on the same row number? Example: Sheet1 R1C1, when I select Sheet2 cursor points to the same address R1C1. Thanks in advance, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Synchronize data across 2 sheets | Excel Worksheet Functions | |||
Synchronize data in two LISTBOXes | Excel Discussion (Misc queries) | |||
Excel merge or synchronize | Excel Discussion (Misc queries) | |||
synchronize between sheets | Excel Worksheet Functions | |||
synchronize multiple worksheets | Excel Worksheet Functions |