Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Synchronize sheets by row?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Synchronize sheets by row?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Synchronize sheets by row?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Synchronize sheets by row?

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
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
Synchronize data across 2 sheets Dr. Hackenbush Excel Worksheet Functions 2 January 22nd 10 06:19 PM
Synchronize data in two LISTBOXes cellist Excel Discussion (Misc queries) 1 October 12th 09 03:39 PM
Excel merge or synchronize Bob Excel Discussion (Misc queries) 2 March 16th 08 01:40 PM
synchronize between sheets Habatz Excel Worksheet Functions 0 March 15th 07 01:17 AM
synchronize multiple worksheets don Excel Worksheet Functions 2 May 3rd 05 03:58 PM


All times are GMT +1. The time now is 10:33 PM.

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"