ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table Data format (https://www.excelbanter.com/excel-programming/397948-pivot-table-data-format.html)

Little Penny

Pivot Table Data format
 
I have a Pivot Table and of course when I double Click one of the
totals it fires up a new worksheet with my data. I have a Macro that
formats the worksheet the way I want it to look for printing. Is the a
way to fire up the macro when I double click one of the totals.


Thanks for your help

Debra Dalgleish

Pivot Table Data format
 
You could add code to the ThisWorkbook module, that will run when a new
sheet is added to the workbook. Check the first cell in the new sheet,
to see if it matches the first cell in the source data table.

For example, if the source data has Date as the first heading, this will
run a macro named FormatSheet:

Private Sub Workbook_NewSheet(ByVal Sh As Object)
If Sh.Cells(1, 1).Value = "Date" Then
FormatSheet
End If

End Sub


Little Penny wrote:
I have a Pivot Table and of course when I double Click one of the
totals it fires up a new worksheet with my data. I have a Macro that
formats the worksheet the way I want it to look for printing. Is the a
way to fire up the macro when I double click one of the totals.


Thanks for your help



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



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

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