'Indiquer le nom de la page de donnée
lop = InputBox("Indiquez le nom de la page de donnée", "Nom Page", "")
Sheets(lop).Activate
Dim derlo As Long
derlo = Cells(65536, 3).End(xlUp).Row
'Indiquer dernière date de la plage de donnée
g = InputBox("Indiquez dernière date", "Date", "06/12/2007")
'Cotation Global
Sheets("Stat ANC").Activate
Dim derligh As Long
derligh = Cells(65536, 2).End(xlUp).Row
cota = 3
For rtcot = 3 To 91 'derligh
i = Sheets("Stat ANC").Cells(cota, 2).Value
Sheets.Add
ActiveSheet.Name = i
'Copie les lignes correpondante sur la feuille de visualisation
gti = i
r = 1
For p = 1 To derlo
Sheets(lop).Activate
If Cells(p, 5).Value = i Then
Rows(p).EntireRow.Copy
Sheets(i).Select
Range("A" & r).Select
ActiveSheet.Paste
r = r + 1
End If
p = p + 1
Next p
'Effacement données inutile sur feuille fournisseur
Sheets(i).Activate
Dim derl As Long
derl = Cells(65536, 5).End(xlUp).Row
For f = derl To 1 Step -1
If Cells(f, 8).Value = "." Or Cells(f, 6).Value = "." Or Cells(f, 8).Value = "" _
Or Cells(f, 13).Value = "" Or Cells(f, 6).Value = "NRC" Or Cells(f, 6).Value = "CA" _
Or Cells(f, 6).Value = "AFFECTATION" Or Cells(f, 6).Value = "TRANSPORT" _
Or Cells(f, 6).Value = "FTRS" Or Cells(f, 6).Value = "DCST" Or Cells(f, 6).Value = "AOG" _
Or Cells(f, 6).Value = "REMP" Or Cells(f, 6).Value = "DEPOSIT" Or Cells(f, 6).Value = "REMPA." _
Or Cells(f, 6).Value = "ACOMPTE" Or Cells(f, 6).Value = "CB" Or Cells(f, 6).Value = "IMPRIMERIE" _
Or Cells(f, 6).Value = "FAA" Or Cells(f, 6).Value = "DCRF" Or Cells(f, 6).Value = "DCRA" _
Or Cells(f, 6).Value = "EASA" Or Cells(f, 6).Value = "OUTILLAGE" Or Cells(f, 6).Value = "PIECE" _
Or Cells(f, 6).Value = "ACCUSE RECEPTION" Or Cells(f, 6).Value = "REM" Or Cells(f, 6).Value = "REMP." _
Or Cells(f, 6).Value = "ACCUSE RECEPTION 1" Or Cells(f, 6).Value = "JAA" _
Then
Rows(f).Select
Selection.Delete Shift:=xlUp
End If
Next f
If Cells(1, 3).Value <> "" Then
'Comptabilise le nombre de référence de commande et le nombre d'élément reçu
Dim derligne As Long
derligne = Cells(65536, 13).End(xlUp).Row
Cells(derligne + 4, 2).Value = Year(Cells(1, 2).Value)
x = Year(Cells(1, 2).Value)
For l = 1 To derligne
If x < Year(Cells(l, 13).Value) Then
x = Year(Cells(l, 13).Value)
End If
Next l
xx = x - Year(Cells(1, 2).Value)
Cells(derligne + 4, 2 + xx).Value = x
For y = 1 To xx
If Cells(derligne + 7, 2).Value + y <> Cells(derligne + 7 + xx, 2).Value Then
Cells(derligne + 4, 2 + y).Value = Cells(derligne + 4, 2) + y
End If
Next y
Cells(derligne + 4, 1).Value = "Année"
Cells(derligne + 5, 1).Value = "Nb cde"
Cells(derligne + 6, 1).Value = "Délai jour"
Cells(derligne + 6, 3 + xx).Value = derligne
c = 0
For k = 1 To derligne
If Cells(k, 14).Value <> "" Then
c = c + 1
End If
Next k
Cells(derligne + 7, 1).Value = "Date Réception"
Cells(derligne + 7, 3 + xx).Value = c
End If
cota = cota + 1
Next rtcot