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
|
Sub Macro1()
'
'
'Déclaration des variables
Dim Fichier As String
Dim bFind As Boolean
Dim sFeuilleHebdo As String
Dim ORDER_ID(65000) As Double, ORIGIN_AMOUNT(65000) As Double
'Form.Hide
'Initialiser des variables
'=========================================================
Sheets("REJET").Activate
'Nombre de Lignes (Nb contrats/regets)
NB_LIGNE_REJET = Range("C65000").End(xlUp).Row
For i = 2 To NB_LIGNE_REJET
ORDER_ID(i) = Cells(i, 3)
ORIGIN_AMOUNT(i) = Cells(i, 5)
'**** on active la feuille SIBO
Sheets("SIBO").Activate
'Nombre de Lignes dans l onglet SIBO
NB_LIGNE_SIBO = Range("C65000").End(xlUp).Row
For j = 1 To NB_LIGNE_SIBO
If Cells(j, 2) = ORDER_ID(i) Then
If Cells(j, 3) <> ORIGIN_AMOUNT(i) Then
If (Cells(j, 4) = "CHRONOPOST_DELIVERY" Or Cells(j, 4) = "CHRONOPOST_ENT") Then
Cells(j, 3) = ORIGIN_AMOUNT(i) - 10
ElseIf Cells(j, 4) = "COLISSIMO_SIGNATURE" Then
Cells(j, 3) = ORIGIN_AMOUNT(i) - 5
Else: Cells(j, 3) = ORIGIN_AMOUNT(i)
End If
End If
End If
Next
Sheets("REJET").Activate
Next
'=========================================================
MsgBox "Mise à jour terminée!", vbInformation
End Sub |
Partager