Hello,
I would like to have a code on my personal macro wb that design the pivot tble to my liking. I am aware that it is possible to save a trmplate of a pivot and to set is as the default. However, every time that I export data to Excel, it doesn't use the deafualt that I want. so, I need your help with the following code:
How do I make the code to work on the current pivot table I am on. Is there an object activepivottable, like there is activecell? Or, maybe I should use for each loop, where the collection is pivottables?
TY
I would like to have a code on my personal macro wb that design the pivot tble to my liking. I am aware that it is possible to save a trmplate of a pivot and to set is as the default. However, every time that I export data to Excel, it doesn't use the deafualt that I want. so, I need your help with the following code:
Code:
Sub Macro3()
Range("B6").Select
With ActiveSheet.PivotTables("PivotTable2")
.DisplayErrorString = True
.ErrorString = "0"
.InGridDropZones = False
End With
ActiveSheet.PivotTables("PivotTable2").TableStyle2 = "PivotStyleLight16"
End Sub
How do I make the code to work on the current pivot table I am on. Is there an object activepivottable, like there is activecell? Or, maybe I should use for each loop, where the collection is pivottables?
TY
Last edited by a moderator: