Re : Macro avec liste intégrée pour imprimer selon critères ou filtre ?
Bonjour Don !
Ca a été hier avec la grêve ?
Mon chef a fini les formules bien casse tête quand même.
Et en plus y’a une faille… Je te mets la formule tu vas mieux comprendre je pense :
' AutoArchivage
Sheets("Actionplan").Activate
For i = 2 To Range("A6553").End(xlUp).Row
If Cells(i, 5) = "þ" Then
derligne = Sheets("Archives").Range("A65535").End(xlUp).Row + 1
Range(Cells(i, 1), Cells(i, 6)).Copy Destination:=Sheets("Archives").Range("A" & derligne)
If Cells(i, 13) = "" Then
Rows(i).Delete
Else
If Cells(i, 13) = "Weekly" Then
Cells(i, 4) = Cells(i, 4) + 7
Cells(i, 5) = "¨"
Cells(i, 6) = ""
End If
If Cells(i, 13) = "Monthly" Then
If Month(Cells(i, 4)) = 1 Or Month(Cells(i, 4)) = 3 Or Month(Cells(i, 4)) = 5 Or Month(Cells(i, 4)) = 7 Or Month(Cells(i, 4)) = 8 Or Month(Cells(i,4)) = 10 Or Month(Cells(i, 4)) = 12 Then
mois = 31
If Month(Cells(i, 4)) = 1 Then
If Day(Cells(i, 4)) = 29 Or Day(Cells(i, 4)) = 30 Or Day(Cells(i, 4)) = 31 Then
mois = 28
End If
End If
Cells(i, 4) = Cells(i, 4) + mois
Else
mois = 30
If Month(Cells(i, 4)) = 2 Then
mois = 28
End If
Cells(i, 4) = Cells(i, 4) + mois
End If
Du coup, quand on met une action au 31 janvier cela répète bien au 28 février mais ensuite au lieu de la répéter au 31 mars et bien on repars sur du 28 mars…
Donc au cas où tu aurais la solution
Pour le tri par date sur la page archive ça ne marche pas chez moi, pourtant cela marchait bien sur ton fichier. Ce n’est pas indispensable mais au cas où, j’aimerais bien l’avoir car sait-on jamais !
Merci encore !