Selection Change Event...

J

Juan Sanchez

Hi All

Does anyone knows if on a "Selection Change" event I can
retrieve the previos active cell??? say I'm on A1 and then
I hit the Left arrow towards A2, is there a way to know
that previosly I was in A1. What if I'm in A1 and then I
go directly to C10 with the mouse, once the selection
change occurs, is it possible to now what the seleciton
was before??

Any help is greatly appreciated...

Regards
JS
 
F

Frank Kabel

Hi
you have to store the old cell in a static variable. something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
static old_range as range
if old_range is nothing then
set old_range = target
else
'do your code
msgbox "Old cell: " & old_range.address
end if
set old_range = target

End Sub
 
Top