how to count columns i pivot table?

  • Thread starter Thread starter ulfb
  • Start date Start date
U

ulfb

Hi
My pivot is dynamic, created with VB, and number of columns will vary.
I need this count in a variable for use in further processing.
Any assistance appreciated!
/ulf
 
Untested:

Sub aj()
myCol = ActiveSheet.PivotTables(1).TableRange2.Columns.Count
MsgBox myCol
End Sub
 
Back
Top