Yes, you are on the right track except the code as you have it would run for
any double click on the sheet, whether on the pivottable or no. To make it
run only if the user double-clicks on the PivotTable, first it would be
easier to put the code in the Worksheet_BeforeDoubleClick event so you
already are sure you are on the right sheet, then check to see if the cell is
in the pivottable range - you do that by using the Intersect method to see if
the Target range intersects (is part of) the pivottable's range which is
either the TableRange1 or TableRange2 property (depends on if you want to
include the field names). Also, one note: you can always replace IF A=True
THEN by IF A THEN; it simplifies the code a bit:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)

If ActiveSheet.PivotTables.EnableDrilldown and _
Not(Intersect(Target, ActiveSheet.PivotTables(1).TableRange2) Is
Nothing) _
Then Call FillColours

End Sub


--
- K Dales


"VBA Noob" wrote:

>
> Hi,
>
> Looking for excel to activate a macro when a user double clicks on a
> pivot table to drill down into what makes up the total. Think I need
> something like the beliow to call my macro called FillColours.
>
> Does anyone have any thoughts ??
>
>
> VBA:
>
> Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
> Target As Range, _
> Cancel As Boolean)
>
>
> If ActiveSheet.PivotTables.EnableDrilldown = True Then Call
> FillColours
>
> End Sub
>
> Thanks
> VBA Noob
>
>
> --
> VBA Noob
> ------------------------------------------------------------------------
> VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
> View this thread: http://www.excelforum.com/showthread...hreadid=536327
>
>