Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Pivot Table Data format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Little Penny - 21 Sep 2007 22:16 GMT
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 - 22 Sep 2007 03:17 GMT
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

> 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

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.