ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table Macro (https://www.excelbanter.com/excel-programming/397906-pivot-table-macro.html)

Little Penny[_2_]

Pivot Table Macro
 
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.


Tom Ogilvy

Pivot Table Macro
 
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.

--
regards,
Tom Ogilvy

"Little Penny" wrote:

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.



Charles Chickering

Pivot Table Macro
 
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
--
Charles Chickering

"A good example is twice the value of good advice."


"Little Penny" wrote:

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.




All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com