Pivot Table Macro

L

Little Penny

I have a pivot table and when I double click the pivot cell it fires
up another worksheet with my data. I then run a macro to format the
sheet to look the way I want. Is it possible to fire up this macro
when I double click the pivot cell.
 
G

Guest

Look at the BeforeDoubleClick event. However this will fire before the
sheet is created.

Look at the NewSheet event in the thisworkbook module. It fires for me when
I double click a pivot cell. the SH argument in the event tells you what the
new sheet name is. You can then check that sheet and see if it has the kind
of information that would indicate it is produced by double clicking the
pivot cell. Or use both events in combination.
 
G

Guest

Penny, right click the pivot table sheet tab at the bottom of your screen
where all the sheet tabs are listed. Choose View code and use this event:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
MsgBox "You Double-Clicked Cell " & Target.Address
'Call Your macro here
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top