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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top