View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Candyman Candyman is offline
external usenet poster
 
Posts: 66
Default Creating reports per Pivot Table PivotItem

I have a pivot table that cna be used to create reports per filtered PIVOT
ITEM.

my code jams when it trys to set the visible properties. Can you help?

Sub CreatePivotTabs()
'Create tabs per Pivot table
Dim x, y As Integer
Dim strLOB_NM, strHideLOB_NM As String

Sheets("Pivot Table").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("LOB")
For x = 1 To .PivotItems.Count
For y = 1 To .PivotItems.Count
If y < x Then
strHideLOB_NM = .PivotItems(y).Name
.PivotItems(strHideLOB_NM).Visible = False
Else
.PivotItems(y).Visible = True
strLOB_NM = .PivotItems(y).Name
End If
Next y
'create report and create on New tab named via strLOB_NM
' FormatAuditIssueTables Sheets("Pivot Table"), strLOB_NM

Sheets("Pivot Table").Select

Next x
End With
End Sub

Thank you so much!