Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Double click a range

Is there a quick way to detect if the user double
clicks a specified range?

I'm currently dealing with the "Target" parameter of
the Worksheet_BeforeDoubleClick() function. I'm
also testing all the Target.Row and Target.Col
combinations to test for a specified range. Is this
the only way to do this??

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Double click a range

Hi Robert

You can use named ranges and Intersect for this.
Name a range of cells ClubbingArea and try this:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim R As Range
On Error Resume Next
Set R = Intersect(Target(1), Range("ClubbingArea"))
If R Is Nothing Then
Cancel = True
MsgBox "Out"
Else
Cancel = True
MsgBox ("in")
End If
End Sub

HTH. Best wishes Harald

"Robert Crandal" skrev i melding
...
Is there a quick way to detect if the user double
clicks a specified range?

I'm currently dealing with the "Target" parameter of
the Worksheet_BeforeDoubleClick() function. I'm
also testing all the Target.Row and Target.Col
combinations to test for a specified range. Is this
the only way to do this??

Thanks.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Double click a range

Robert Crandal wrote:
Is there a quick way to detect if the user double
clicks a specified range?

I'm currently dealing with the "Target" parameter of
the Worksheet_BeforeDoubleClick() function. I'm
also testing all the Target.Row and Target.Col
combinations to test for a specified range. Is this
the only way to do this??

Thanks.




that is the only way


if not intersect (target, <range you are interested in) is nothing then

.... your code here .....
end if




just be careful with one thing

target can overlap with <your range but does not have to be fully
included in it.
just decide if in your code you want to play with target or with
intersect (target, <your range)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Double click a range

Something like this, perhaps...

If Target.Address < Range("MySpecificRange").Address Then Exit Sub

OR

If Intersect(Target, Range("MySpecificRange")) Is Nothing Then Exit Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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 change syperlink from single click to double click syperlinker Excel Worksheet Functions 0 June 13th 08 05:01 PM
userform label double-click goes to click event John Paul Fullerton Excel Programming 3 May 19th 06 05:54 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Mouse Over Graph, Capture Information on Click(Double Click) Dean Hinson[_3_] Excel Programming 1 December 6th 04 04:49 AM
Double click to print active range Bob Wall Excel Programming 1 September 6th 04 04:55 AM


All times are GMT +1. The time now is 11:34 PM.

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"