'
With ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotFields("Date")
'affiche tout
.CurrentPage = "(All)"
.EnableMultiplePageItems = True
'vérif si possible
possible = 0
For i = 1 To .PivotItems.Count
If CDate(.PivotItems(i).Name) < Range("A2").Value Or CDate(.PivotItems(i).Name) > Range("B2").Value Then
.PivotItems(i).Visible = False
Else
.PivotItems(i).Visible = True
possible = 1
End If
Next
If possible = 0 Then MsgBox "période non valide"
End With