Hi Experts,

i found this code but I could not modify it so it would work on two pivot tables on the same sheet:

Set TargetDate = Range("A1")
Dim PI As PivotItem


For Each PI In ActiveSheet.PivotTables("PivotTable1").PivotFields("Target Due Date").PivotItems
If DateValue(PI.Name) < TargetDate Or DateValue(PI.Name) = TargetDate Then
PI.Visible = True
Else
PI.Visible = False
End If
Next PI

How do I get a code to work on at least two pivot tables on the same sheet?

I apologize if i do not know how to use code tags.

Thank you