From 0da29849074505427a4e7245997c6e68c7e72dd1 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 16 Jan 2019 14:48:19 -0500 Subject: [PATCH] reference parent position --- pivot.bas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pivot.bas b/pivot.bas index f442cc3..e8a83b1 100644 --- a/pivot.bas +++ b/pivot.bas @@ -1,5 +1,7 @@ Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) + 'Exit Sub + Cancel = True Dim i As Long @@ -29,7 +31,7 @@ Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean For i = 1 To ci.Count sql = sql & vbCrLf & "AND " - sql = sql & cd(piv_pos(cd, i)).Name & " = '" & ci(i).Name & "'" + sql = sql & cd(piv_pos(cd, ci(i).Parent.Position)).Name & " = '" & ci(i).Name & "'" Next i MsgBox (sql)