Double click with multiple ranges

skapunkboy

New Member
Joined
Apr 29, 2015
Messages
8
Hi All

my searchfu is weak as such I have signed up in search of answers

I want to run a before double click even for multiple ranges of data all linked to different macro's

I’m pretty much a beginner at this.

I have made it work for single clicks as you can see below but I can't get the same logic applied to double click

Private Sub Worksheet_Sectionchange(ByVal Target As Range, Cancel As Boolean)
Dim Cell As Range
For Each Cell In Target
If Not Intersect(Cell, Range("a1:j1,a3:a13")) Is Nothing Then
Run "Macro1"
ElseIf Not Intersect(Cell, Range("a18:j18,a20:a30")) Is Nothing Then
Run "Macro2"
ElseIf Not Intersect(Cell, Range("a35:j35,a37:a47")) Is Nothing Then
Run "Macro3"
ElseIf Not Intersect(Cell, Range("a52:j52,a54:a64")) Is Nothing Then
Run "Macro4"
ElseIf Not Intersect(Cell, Range("a69:j69,a71:a81")) Is Nothing Then
Run "Macro5"
ElseIf Not Intersect(Cell, Range("a86:j86,a88:a98")) Is Nothing Then
Run "Macro6"
ElseIf Not Intersect(Cell, Range("a103:j103,a105:a115")) Is Nothing Then
Run "Macro7"
ElseIf Not Intersect(Cell, Range("a120:j120,a122:a132")) Is Nothing Then
Run "Maco8"
ElseIf Not Intersect(Cell, Range("a137:j137,a139:a149")) Is Nothing Then
Run "Macro9"
ElseIf Not Intersect(Cell, Range("a154:j154,a156:a166")) Is Nothing Then
Run "Macro10"
ElseIf Not Intersect(Cell, Range("a171:j171,a173:a183")) Is Nothing Then
Run "Macro11"
ElseIf Not Intersect(Cell, Range("a188:j188,a190:a200")) Is Nothing Then
Run "Macro12"
ElseIf Not Intersect(Cell, Range("a205:j205,a207:a217")) Is Nothing Then
Run "Macro13"
ElseIf Not Intersect(Cell, Range("a222:j222,a224:a234")) Is Nothing Then
Run "Macro14"
ElseIf Not Intersect(Cell, Range("a239:j239,a241:a251")) Is Nothing Then
Run "Macro15"
ElseIf Not Intersect(Cell, Range("a256:j256,a258:a268")) Is Nothing Then
Run "Macro16"
ElseIf Not Intersect(Cell, Range("a273:j273,a275:a285")) Is Nothing Then
Run "Macro17"
End If
Next Cell
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Ignore me I'm an idiot, I've removed the
"Dim Cell As Range
For Each Cell In Target"

and changed all of the Cell, Range to Target, Range

and then it all works!


Hi All

my searchfu is weak as such I have signed up in search of answers

I want to run a before double click even for multiple ranges of data all linked to different macro's

I’m pretty much a beginner at this.

I have made it work for single clicks as you can see below but I can't get the same logic applied to double click

Private Sub Worksheet_Sectionchange(ByVal Target As Range, Cancel As Boolean)
Dim Cell As Range
For Each Cell In Target
If Not Intersect(Cell, Range("a1:j1,a3:a13")) Is Nothing Then
Run "Macro1"
ElseIf Not Intersect(Cell, Range("a18:j18,a20:a30")) Is Nothing Then
Run "Macro2"
ElseIf Not Intersect(Cell, Range("a35:j35,a37:a47")) Is Nothing Then
Run "Macro3"
ElseIf Not Intersect(Cell, Range("a52:j52,a54:a64")) Is Nothing Then
Run "Macro4"
ElseIf Not Intersect(Cell, Range("a69:j69,a71:a81")) Is Nothing Then
Run "Macro5"
ElseIf Not Intersect(Cell, Range("a86:j86,a88:a98")) Is Nothing Then
Run "Macro6"
ElseIf Not Intersect(Cell, Range("a103:j103,a105:a115")) Is Nothing Then
Run "Macro7"
ElseIf Not Intersect(Cell, Range("a120:j120,a122:a132")) Is Nothing Then
Run "Maco8"
ElseIf Not Intersect(Cell, Range("a137:j137,a139:a149")) Is Nothing Then
Run "Macro9"
ElseIf Not Intersect(Cell, Range("a154:j154,a156:a166")) Is Nothing Then
Run "Macro10"
ElseIf Not Intersect(Cell, Range("a171:j171,a173:a183")) Is Nothing Then
Run "Macro11"
ElseIf Not Intersect(Cell, Range("a188:j188,a190:a200")) Is Nothing Then
Run "Macro12"
ElseIf Not Intersect(Cell, Range("a205:j205,a207:a217")) Is Nothing Then
Run "Macro13"
ElseIf Not Intersect(Cell, Range("a222:j222,a224:a234")) Is Nothing Then
Run "Macro14"
ElseIf Not Intersect(Cell, Range("a239:j239,a241:a251")) Is Nothing Then
Run "Macro15"
ElseIf Not Intersect(Cell, Range("a256:j256,a258:a268")) Is Nothing Then
Run "Macro16"
ElseIf Not Intersect(Cell, Range("a273:j273,a275:a285")) Is Nothing Then
Run "Macro17"
End If
Next Cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,263
Members
449,219
Latest member
daynle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top