Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the SelectionChange event like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target(1, 1), Range("m1:m1")) Is Nothing Then Exit Sub .... End Sub My question is if it's a way to retrieve which cell was selected before the M1 cell is selected? Regards Frank Krogh |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Frank
Here's a way to do it: Dim LastSelected As String Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target(1, 1), Range("m1:m1")) Is Nothing Then GoTo XIT MsgBox LastSelected '... XIT: LastSelected = Target.Address End Sub Regards, Per "Frank Krogh" skrev i meddelelsen ... I am using the SelectionChange event like this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target(1, 1), Range("m1:m1")) Is Nothing Then Exit Sub ... End Sub My question is if it's a way to retrieve which cell was selected before the M1 cell is selected? Regards Frank Krogh |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for the solution.
Frank "Per Jessen" wrote: Hi Frank Here's a way to do it: Dim LastSelected As String Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target(1, 1), Range("m1:m1")) Is Nothing Then GoTo XIT MsgBox LastSelected '... XIT: LastSelected = Target.Address End Sub Regards, Per "Frank Krogh" skrev i meddelelsen ... I am using the SelectionChange event like this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target(1, 1), Range("m1:m1")) Is Nothing Then Exit Sub ... End Sub My question is if it's a way to retrieve which cell was selected before the M1 cell is selected? Regards Frank Krogh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
Retrieve selected data from Network file | Excel Programming | |||
Macro to take selected cells times a selected cell | Excel Programming | |||
programatically retrieve selected rows from excel workbook | Excel Programming |