Mon tableau a une vue sur 12 mois. Par ex là : FEV 2018 à JAN2019. Et le mois prochain ce même tableau débutera de AVRIL 2018 à MARS 2019 ainsi de suite. Le tableau est mis à jour manuellement pour l'instant. Donné le mois actuel, je devais revenir en arrière et filtrer les informations des mois précedents jusqu'au mois avant le mois actuel donc jusqu'en janvier 2019.
Comment puis je le mettre à jour automatiquement tel que les filtres des mois s'applique des qu'on passe à la prochaine colonne.
En attendant, la macro ci-dessus me permet de passer d'une colonne à l'autre sans pourtant appliquer des filtre. En somme ça ne fait pas grande chose part la facilité de remplir une seule colonne.
Pour toute proposition ou question de clarification, je vous sais gré.
Sub LUUUP()
Dim StartDate As Long, EndDate As Long
Dim i As Long, nextmonth As Long
i = 0
For x = 1 To 12
i = i + 1
If x = 1 Then y = "C"
If x = 2 Then y = "D"
If x = 3 Then y = "E"
If x = 4 Then y = "F"
If x = 5 Then y = "G"
If x = 6 Then y = "H"
If x = 7 Then y = "I"
If x = 8 Then y = "J"
If x = 9 Then y = "K"
If x = 10 Then y = "L"
If x = 11 Then y = "M"
If x = 12 Then y = "N"
Sheets("Analyse").Select
With ActiveSheet
If i + 1 = True Then nextmonth = DateSerial(Year(Date), Month(Date) + 12 - 1, 1)
End With
Sheets("Analyse").Select
ActiveSheet.ListObjects("Tableau1").Range.AutoFilter Field:=12, Criteria1:= _
xlFilterLastMonth, Operator:=xlFilterDynamic
Range("C1").Copy
Sheets("feuil1").Select
Range( "C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next x
End Sub