Hi. Does anny one know what it wrong wit this code. It bugs at the visible = true line...
Thanks Felix
================================================== ===
Sub Pivotgroupall()
On Error GoTo err_handler
' Unhide all items
Sheets(Dataworksheet).Select
Dim NameofItem As String
Pivotname = "Pivottable1"
Fieldname = "CATEGORY"
With ActiveSheet.PivotTables(Pivotname).PivotFields(Fie ldname)
For x = 1 To .PivotItems.Count
NameofItem = .PivotItems(x).Name
If .PivotItems.Item(NameofItem).Visible = False Then
.PivotItems(NameofItem).Visible = True
End If
Next
End With
Sheets("REPORT").Select
err_handler:
Application.ScreenUpdating = True
MsgBox Error_text & Err.Number & Err.Description, vbCritical
End Sub
================================================== ===