Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I change selectio in a worksheet, the range that I select is passed to
the SelectionChange event as Target. How can I identify the range that I have changed from? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You would need to put in a static variable in the selectionchange event and
update it as you exit the selectionchange event. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim oldSelection as Static ' code that does things set OldSelection = Target End Sub if you will have to use this value on the very first selectionchange, then you will need to make it a public variable in a general module and initialize it in the Workbook_Open event. -- Regards, Tom Ogilvy "Hayeso" wrote in message ... When I change selectio in a worksheet, the range that I select is passed to the SelectionChange event as Target. How can I identify the range that I have changed from? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom, That makes sense.
"Tom Ogilvy" wrote: You would need to put in a static variable in the selectionchange event and update it as you exit the selectionchange event. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim oldSelection as Static ' code that does things set OldSelection = Target End Sub if you will have to use this value on the very first selectionchange, then you will need to make it a public variable in a general module and initialize it in the Workbook_Open event. -- Regards, Tom Ogilvy "Hayeso" wrote in message ... When I change selectio in a worksheet, the range that I select is passed to the SelectionChange event as Target. How can I identify the range that I have changed from? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to use selectionchange instead of doubleclick event? | Excel Discussion (Misc queries) | |||
Worksheet SelectionChange Event | Excel Discussion (Misc queries) | |||
Worksheet SelectionChange event | Excel Programming | |||
SelectionChange event | Excel Programming | |||
SelectionChange Event | Excel Programming |