Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old October 18th 05, 03:17 PM
 
Posts: n/a
Default Reset a caption for a Pivot Table

Hello all,

Thanks for taking a look at this for me.

I have a worksheet with many pivot tables on it. A user has typed a
'0' over one of the data sets.

I need to get the 0 back to the original data.

Here is the tricky part: I want all my other captions to stay the
same, and this particualar field does not exsist in all my pivot
tables, so I need something like this:


Where the field "Departure Station" exsists then do this but only for
the filed Departure Station. This Macro fails when it gets to Pivot
table p20, because p20 does not have Departure Station.

Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim Sfld As String
Sfld = "Departure Station"


For Each pt In ActiveSheet.PivotTables
Set pf = pt.PivotFields(Sfld)
For Each pi In pf.PivotItems
pi.Caption = pi.SourceName
Next pi

pt.RefreshTable
Next pt


Any help would be great!

Thanks

Doug


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
updating pivot table to include additional rows Ellen Excel Discussion (Misc queries) 8 July 15th 08 01:33 PM
pivot table created from another pivot table Kreed Excel Worksheet Functions 6 October 26th 05 04:16 PM
Change Data In Pivot Table John Calder New Users to Excel 1 July 7th 05 10:41 PM
Pivot table, dynamic data formula Excel GuRu Excel Discussion (Misc queries) 3 May 3rd 05 10:45 PM
Pivot Table Problems Rachel Gonsior Excel Discussion (Misc queries) 3 March 21st 05 07:24 PM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017