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
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