Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This method works on the second and subsequent cursor movement but
obviously not on the first cursor movement since prevTarget and currTarget are initially null. Any ideas on how to capture the previous active cell on the first cursor movement? Mike Woodhouse wrote: I can only think of tracking SelectionChange events. Try putting this in your worksheet's Module: Option Explicit Dim prevTarget As Range Dim currTarget As Range Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next ' Lazy workaround for empty objects first time through Set prevTarget = currTarget Set currTarget = Target Debug.Print "Now at " & currTarget.Address & ", previously at " & prevTarget.Address On Error GoTo 0 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find address of active cell | Excel Worksheet Functions | |||
how to compare the active cell value to the previous cell's value | Excel Programming | |||
Previous active cell | Excel Programming | |||
How do I reference the cell address next to Active cell - Try 2 | Excel Programming | |||
How do I reference the cell address next to Active cell | Excel Programming |