![]() |
Navigating in Excel sheets
I have several worksheets which are the same layout, with different
information, all related. I would like to move around in one sheet, and when i go to another sheet, have the same position displayed. I do not want any changes I make to a cell on one sheet to hard enter on the other sheet, so highlighting all the tabs is not an option. I would like that when I go to another sheet, the same cell is in the window to see the effects, rather than scroll around to find it. |
Navigating in Excel sheets
If you want to use a couple of macros, you can do it.
Option Explicit Dim CurActCellAddr As String Dim TopLeftCellAddr As String Private Sub Workbook_Open() CurActCellAddr = ActiveCell.Address TopLeftCellAddr = ActiveWindow.VisibleRange.Cells(1, 1).Address End Sub Private Sub Workbook_SheetActivate(ByVal Sh As Object) If CurActCellAddr = "" Then 'do nothing Else With Application .EnableEvents = False If TopLeftCellAddr = "" Then 'do nothing Else .Goto Sh.Range(TopLeftCellAddr), scroll:=True End If Sh.Range(CurActCellAddr).Select .EnableEvents = True End With End If CurActCellAddr = ActiveCell.Address End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Range) CurActCellAddr = ActiveCell.Address TopLeftCellAddr = ActiveWindow.VisibleRange.Cells(1, 1).Address End Sub rightclick on the excel icon to the left of the File|edit|view (on the worksheet menubar). select view code and paste this in. Then try it out. The first time the address gets initialized is with the workbook open event. If you test without closing/reopening your workbook, it may take one selection change to "prime the pump." Duane wrote: I have several worksheets which are the same layout, with different information, all related. I would like to move around in one sheet, and when i go to another sheet, have the same position displayed. I do not want any changes I make to a cell on one sheet to hard enter on the other sheet, so highlighting all the tabs is not an option. I would like that when I go to another sheet, the same cell is in the window to see the effects, rather than scroll around to find it. -- Dave Peterson |
All times are GMT +1. The time now is 02:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com