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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| Sub données_taux_de_service()
'
tol = Application.Names("tol").RefersToRange
Sheets("OA").Select
Cells(65536, 1).Select
Selection.End(xlUp).Select
nl_fin = Selection.Row
Sheets("données_taux_service").Select
'
' initialisation
' Application.Goto Reference:="data_ts"
' Selection.Offset(1, 0).Select
' Selection.ClearContents
'
Cells(65536, 1).Select
Selection.End(xlUp).Select
nl_suppl = Selection.Row
Range(Cells(2, 1), Cells(nl_suppl, 40)).Select
'<VBA_INSPECTOR>
' <CHANGE>
' <MESSAGE>Potentially contains changed items in the object model</MESSAGE>
' <ITEM>[xls]ChartArea.ClearContents</ITEM>
' <URL>http://go.microsoft.com/fwlink/?LinkID=215357 </URL>
' </CHANGE>
'</VBA_INSPECTOR>
Selection.ClearContents
'
nl_suppl = 1
'
For nl = 4 To nl_fin
date_cde = Sheets("OA").Cells(nl, col_date_cde)
due_date = Sheets("OA").Cells(nl, col_due_date)
reciev_date = Sheets("OA").Cells(nl, col_reciev_date)
cde = Sheets("OA").Cells(nl, col_Ligne_cde) = 1
liv = Sheets("OA").Cells(nl, col_Livraison) = 1
If cde Then
' on ne tient pas compte des commandes annulées
If liv Then
' cas des livraisons effectuées
If reciev_date > due_date + tol Then
' cas des livraisons en retard
reciev_date_conv = DateSerial(Year(reciev_date), Month(reciev_date), 15)
due_date_conv = DateSerial(Year(due_date + tol), Month(due_date + tol), 15)
If reciev_date_conv > due_date_conv Then
date_temp = due_date_conv
Range(Sheets("OA").Cells(nl, 1), Sheets("OA").Cells(nl, 38)).Copy
'
While date_temp < reciev_date_conv
nl_suppl = nl_suppl + 1
If nl_suppl < 65000 Then
Cells(nl_suppl, 1).Select
'réactivation ligne suivante rb 10092010
ActiveSheet.Paste
'<VBA_INSPECTOR>
' <CHANGE>
' <MESSAGE>Potentially contains changed items in the object model</MESSAGE>
' <ITEM>[xls]Range.PasteSpecial</ITEM>
' <URL>http://go.microsoft.com/fwlink/?LinkID=215357 </URL>
' </CHANGE>
'</VBA_INSPECTOR>
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Cells(nl_suppl, col_ts_année) = Year(date_temp)
Cells(nl_suppl, col_ts_mois) = Month(date_temp)
Cells(nl_suppl, col_ts_àlheure) = "en retard de livraison"
Cells(nl_suppl, col_ts_cpt_nl2) = 1
Cells(nl_suppl, col_ts_cpt_nl1) = -1
Cells(nl_suppl, col_ts_année_mois) = Year(date_temp) & "-" & Format(Month(date_temp), "00")
date_temp = date_temp + 31
date_temp = DateSerial(Year(date_temp), Month(date_temp), 15)
Else
date_temp = reciev_date_conv
nl = nl_fin
End If
Wend
End If |
Partager