1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| 'Sub est le debut de la procedure
Sub Rappel()
'Dim est une variable
Dim Nom, numero_ligne, DateEnvoi, NomLot, Total, Rappel
Dim Onglet As Worksheet
Dim DateJour, DateLimite
Dim Cible, Cpt
'DateJour = A la date du systeme
DateJour = Date
Couleur = ActiveCell.Font.Color
nb_lignes = WorksheetFunction.CountA(Range("A:A")) - 2 'Fonction NBVAL
Cible = "Feuil1"
Cpt = 6
Nom = Range("A1").Value
'For Each Onglet In Worksheets
While Cpt <= 12
DateLimite = Range("D" & Cpt).Value
numero_ligne = Range("F5") + Cpt
DateEnvoi = Format(Cells(numero_ligne, 1), "dd/mm")
NomLot = Cells(numero_ligne, 2)
Total = Cells(numero_ligne, 3)
Rappel = Format(Cells(numero_ligne, 4), "dd/mm")
If DateJour >= DateLimite Then
Range("A1").Copy Worksheets(Cible).Range("A" & Cpt)
Cells(numero_ligne, 1).Copy Worksheets(Cible).Range("B" & Cpt)
Cells(numero_ligne, 2).Copy Worksheets(Cible).Range("C" & Cpt)
Cells(numero_ligne, 3).Copy Worksheets(Cible).Range("D" & Cpt)
Cells(numero_ligne, 4).Copy Worksheets(Cible).Range("E" & Cpt)
Cpt = Cpt + 1
Else
Cpt = Cpt + 1
End If
Wend
'Next
End Sub |