Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Selection Change Event...

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Selection Change Event...

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

--
Regards
Frank Kabel
Frankfurt, Germany


Juan Sanchez wrote:
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

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
Quick VBA Worksheet Change Event or Selection Question: Damil4real Excel Worksheet Functions 6 November 17th 09 10:28 PM
How to use selection change instead of double click event? ghost Excel Discussion (Misc queries) 1 December 26th 08 04:58 AM
Chart Values that change based on Change event ExcelMonkey[_119_] Excel Programming 1 May 15th 04 03:43 AM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
Autofilter.Selection - After Change Event??? Paul M.[_2_] Excel Programming 0 August 15th 03 05:16 AM


All times are GMT +1. The time now is 09:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"