Originally Posted by
Djblois
I created this code to exclude any items in a Pivot table whos Start Date Didn't start yet or End Date Ended Already. However, if the Start Date is last year it is hiding the row. I can't figure it out?
[vba]Sub ShowCurrent()
Dim pvtItem As PivotItem
Set pvtTable = ActiveSheet.Range("A2").PivotTable
'Hide any completed Contracts
For Each pvtItem In pvtTable.PivotFields("End Contract").PivotItems
I think that the pivotitem of the endcontract needs to be smaller than the current date to be hidden
If pvtItem > Date Then
pvtItem.Visible = False
'Debug.Print ">" & pvtItem
Else
pvtItem.Visible = True
End If
Next
Set pvtItem = Nothing
End Sub[/vba]
Please Help?