Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Multi select with doubleclick event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Multi select with doubleclick event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Multi select with doubleclick event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Multi select with doubleclick event

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
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
how to use selectionchange instead of doubleclick event? ghost Excel Discussion (Misc queries) 0 December 24th 08 05:00 AM
Is Multi click Event possible? Ayo Excel Discussion (Misc queries) 6 August 31st 07 10:42 PM
Select Multi in Listbox - Event Click not working François Excel Programming 0 March 30th 06 07:56 PM
Date Doubleclick Event PG Oriel Excel Programming 2 February 14th 06 11:49 AM
Extract values from a multi-select multi-column list-box Peter[_20_] Excel Programming 5 September 28th 03 04:04 PM


All times are GMT +1. The time now is 01:50 AM.

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

About Us

"It's about Microsoft Excel"