Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change syperlink from single click to double click | Excel Worksheet Functions | |||
userform label double-click goes to click event | Excel Programming | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
Mouse Over Graph, Capture Information on Click(Double Click) | Excel Programming | |||
Double click to print active range | Excel Programming |