Let's say I have a Pivot Table that looks like this but it has over 50 rows:
Letter |
Hours |
A |
5 |
C |
10 |
D |
8 |
In the table above the Letter B has a total of 0 hours so it is filtered out; therefore, it isn't displayed.
I want to create a loop that displays the number of Hours for each Letter that is in the table. When it gets to Letter B, I get an error. What's the workaround?
Here's my code:
For Each pt_item In pt.PivotFields("Letter").PivotItems
MsgBox pt.PivotFields("Letter").PivotItems(pt_item.Value).DataRange.Value
Next
Thanks!
Bookmarks