We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

pivottable result row count

Hoboly
Hoboly asked
on
Medium Priority
695 Views
Last Modified: 2012-06-21
What vba code can I use to get the number of rows of the  result?
I have tried the following code but none of them give me the answer "0".

? ActiveSheet.PivotTables("PivotTable1").DataBodyRange.Count()
1
? ActiveSheet.PivotTables("PivotTable1").TableRange2.Rows.Count
3
? ActiveSheet.PivotTables("PivotTable1").TableRange1.Rows.Count
3

Thanks!
ScreenHunter-01-2011-04-20-11.20.jpg
Comment
Watch Question

In your case an empty pivot will give you 3 rows

ActiveSheet.PivotTables("PivotTable1").TableRange2.Rows.Count

will give you 3

2 for the Headers and 1 for the 1st reserved row.

Sid
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
TracyVBA Developer
CERTIFIED EXPERT

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.