Hi All,
Can you please help with this code - it's currently giving me this error message:
Object Doesn't support this property or method
for this line "For Each Field In ActiveSheet.PivotTables.PivotFields"
Thank you!
Can you please help with this code - it's currently giving me this error message:
Object Doesn't support this property or method
for this line "For Each Field In ActiveSheet.PivotTables.PivotFields"
Thank you!
VBA Code:
Sub FormatNumbersPivot()
'
' FormatNumbersPivot Macro
' Numbers in comma style, remove contextual tooltip, Pivot classic style
'
'
Dim PT As PivotTable
Dim Field As PivotFields
For Each PT In ActiveSheet.PivotTables
PT.InGridDropZones = True
PT.DisplayContextTooltips = False
PT.RowAxisLayout xlTabularRow
Next
For Each Field In ActiveSheet.PivotTables.PivotFields
Field.NumberFormat = "_-* #,##0_-;-* #,##0_-;_-* ""-""_-;_-@_-"
' End With
Next
End Sub