Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivot Table Formatting Question 1

Status
Not open for further replies.

ccepaulb

Technical User
Joined
Jan 29, 2004
Messages
89
Location
US
I have a pivot table set-up under a formatted table on an Excel worksheet. The problem I am having is that whenever I toggle or change something within my pivot table, it changes the formating of the cell and columns adjacent to it.
Is there a way to set-up a pivot table so that it does not change any formatting when changed? (especially the column widths)?

Thanks, Paul
 
Hi,

No -- record a macro that formats your sheet the way you want and use it after you refresh your table.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
That's what I was afraid of...Thanks
 
The following will change all fields to a number format, and you could simply assign it to a toolbar button and set it up to do the most common one you use, and then fix any odd cols manually.

Sub PivFormat()

For Each pt In ActiveSheet.PivotTables
For Each pf In pt.DataFields
pf.NumberFormat = "#,##" & s
Next pf
Next pt

End Sub


Regards
Ken...............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top