Reset PivotItems caption in VBA (1 Viewer)

ParanoidAndroid

Mechanically Depressed
Local time
Today, 21:06
Joined
Sep 2, 2008
Messages
18
Hi there people,

I would like to be able to remove any captions from a pivot using VBA.

I know how to change a caption in VBA:
...
ActiveSheet.PivotTables("PivotTable1").PivotFields("Name").PivotItems("SmithF").Caption = "Fred Smith"
...
And I have found out how to remove the captions by removing the field from the pivot and refreshing before adding the field back... but can't seem to find out how to remove the captions without removing the field via VBA.

My google-fu is weak today. :(
 
Last edited:

___

¯¯¯¯¯
Local time
Today, 21:06
Joined
Nov 27, 2003
Messages
595
.Caption = ""

Maybe?

Something like this...

Code:
   For Each ctl In Me.Controls
         If TypeName(ctl) = "Label" Then
             ctl.Caption = ""
         End If
   Next ctl
 
Last edited:

Users who are viewing this thread

Top Bottom