OleMiss2010
Member
I have a pivot table with a large amount of data. There are thousands of IDs that I need to filter down to about seventy. I have those IDs in the range("G2:G71") and I want the pivottable to only display those values.
I have my current macro below, but I get an error on the line where I tell it what to make visible.
[pre]
[/pre]
I have my current macro below, but I get an error on the line where I tell it what to make visible.
[pre]
Code:
Sub Macro3()
For Each Cell In Range("G2:G71")
With Cell
Cell.Select
Selection.Copy
Range("C1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With ActiveSheet.PivotTables("PivotTable1").PivotFields("ID")
.PivotItems(C1).Visible = True
End With
End With
Next Cell
End Sub