phoeberunner
New Member
- Joined
- May 12, 2011
- Messages
- 16
Hi All,
I have "Country" in a pivot PageField.
The "Country" field has 4 pivotItems: China, India, Spain, Taiwan, where China is unchecked.
I would like to know visible (checked) items for "Country" field.
Here is my code,
For i = 1 To pvt.PageFields.Count
With mySheet
.Range(.Cells(1, 1), .Cells(nRowEnd, nColEnd)).Select
Selection.AutoFilter
If pvt.PageFields(1).AllItemsVisible <> True Then
For k = 1 To pvt.PageFields(i).PivotItems.Count
Debug.Print pvt.PageFields(i).PivotItems(k).Visible
Next k
End If
End With
Next i
The result returned is
FALSE
FALSE
FALSE
FALSE
The correct result is supposed to be
FALSE
TRUE
TRUE
TRUE
as China is unchecked and the rest is checked.
Does anyone know to solve my problem?
Thanks!
I have "Country" in a pivot PageField.
The "Country" field has 4 pivotItems: China, India, Spain, Taiwan, where China is unchecked.
I would like to know visible (checked) items for "Country" field.
Here is my code,
For i = 1 To pvt.PageFields.Count
With mySheet
.Range(.Cells(1, 1), .Cells(nRowEnd, nColEnd)).Select
Selection.AutoFilter
If pvt.PageFields(1).AllItemsVisible <> True Then
For k = 1 To pvt.PageFields(i).PivotItems.Count
Debug.Print pvt.PageFields(i).PivotItems(k).Visible
Next k
End If
End With
Next i
The result returned is
FALSE
FALSE
FALSE
FALSE
The correct result is supposed to be
FALSE
TRUE
TRUE
TRUE
as China is unchecked and the rest is checked.
Does anyone know to solve my problem?
Thanks!