Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want the user to do a multi-select in a column using the ctrl+click and
doubleclick on the last selected row. Using the beforedoubleclick event on a sheet doesn't capture the event at all. It only works when I double click on 1 cell. Here's what I am using. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Intersect(Range("A:A"), Target) Is Nothing Then Else MsgBox ActiveWindow.RangeSelection.Address End If End Sub Is the function "Range.Address" the only way to capture the different row in the selection range? I just want to know the row that it's selected. Can anyone help me. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure I understand what you are asking, but here is one way to return the
row number. Sub rw() MsgBox "Row is " & ActiveCell.Row End Sub "matelot" wrote: I want the user to do a multi-select in a column using the ctrl+click and doubleclick on the last selected row. Using the beforedoubleclick event on a sheet doesn't capture the event at all. It only works when I double click on 1 cell. Here's what I am using. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Intersect(Range("A:A"), Target) Is Nothing Then Else MsgBox ActiveWindow.RangeSelection.Address End If End Sub Is the function "Range.Address" the only way to capture the different row in the selection range? I just want to know the row that it's selected. Can anyone help me. Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you double-Click it selects that cell.
Hence in your Worksheet_BeforeDoubleClick routine, Target will be only the cell that was double-clicked, not the previous selection made with CTRL+Click. Maybe use the Worksheet_BeforeRightClick event instead. NickHK "matelot" wrote in message ... I want the user to do a multi-select in a column using the ctrl+click and doubleclick on the last selected row. Using the beforedoubleclick event on a sheet doesn't capture the event at all. It only works when I double click on 1 cell. Here's what I am using. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Intersect(Range("A:A"), Target) Is Nothing Then Else MsgBox ActiveWindow.RangeSelection.Address End If End Sub Is the function "Range.Address" the only way to capture the different row in the selection range? I just want to know the row that it's selected. Can anyone help me. Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the response. I replace the event with Right-mouse click and it
works. I guess that's one way to implement it rather than double-click the cell. Thanks. "NickHK" wrote: When you double-Click it selects that cell. Hence in your Worksheet_BeforeDoubleClick routine, Target will be only the cell that was double-clicked, not the previous selection made with CTRL+Click. Maybe use the Worksheet_BeforeRightClick event instead. NickHK "matelot" wrote in message ... I want the user to do a multi-select in a column using the ctrl+click and doubleclick on the last selected row. Using the beforedoubleclick event on a sheet doesn't capture the event at all. It only works when I double click on 1 cell. Here's what I am using. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Intersect(Range("A:A"), Target) Is Nothing Then Else MsgBox ActiveWindow.RangeSelection.Address End If End Sub Is the function "Range.Address" the only way to capture the different row in the selection range? I just want to know the row that it's selected. Can anyone help me. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to use selectionchange instead of doubleclick event? | Excel Discussion (Misc queries) | |||
Is Multi click Event possible? | Excel Discussion (Misc queries) | |||
Select Multi in Listbox - Event Click not working | Excel Programming | |||
Date Doubleclick Event | Excel Programming | |||
Extract values from a multi-select multi-column list-box | Excel Programming |