Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel XP & Win XP
Is there a way to find the previous active cell? I want to use a Worksheet_SelectionChange event macro to fire when a selection change is made and then I want that macro to tell me the previous active cell. My end goal is to force a tab sequence in a group of cells even when a cell entry is not made. Thanks for your time. Otto |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps something like this embedded directly in the sheet...
Private Sub Worksheet_Activate() MsgBox "Current Address " & ActiveCell.Address MsgBox "Last address " & LastCell.Address End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) MsgBox "Current Address " & Target.Address MsgBox "Last address " & LastCell.Address End Sub Private Function LastCell() As Range Static rngLastCell As Range If rngLastCell Is Nothing Then Set rngLastCell = ActiveCell Set LastCell = rngLastCell Set rngLastCell = ActiveCell End Function -- HTH... Jim Thomlinson "Otto Moehrbach" wrote: Excel XP & Win XP Is there a way to find the previous active cell? I want to use a Worksheet_SelectionChange event macro to fire when a selection change is made and then I want that macro to tell me the previous active cell. My end goal is to force a tab sequence in a group of cells even when a cell entry is not made. Thanks for your time. Otto |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Previous active cell | Excel Programming | |||
Find cell address of previous active cell | Excel Programming | |||
Find first previous cell with data | New Users to Excel | |||
how to compare the active cell value to the previous cell's value | Excel Programming | |||
Previous active cell | Excel Programming |