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
| Sub Test()
With Sheets("SUIVTRANS EN COURS")
derligne = .Range("A" & Rows.Count).End(xlUp).Row
For j = 2 To derligne
somme = 0
codeP = .Cells(j, "H")
For i = LBound(Tablo, 1) To UBound(Tablo, 1)
If .Cells(j, "J") = Tablo(i, 1) Then
If .Cells(i + 1, "H") <> codeP Then
GoTo pasDeCommentaire
Else
somme = somme + CDbl(Tablo(i, 2))
End If
End If
'ANNULATION TECHNIQUE (5)
' If Mid(.Cells(j, "F").Text, 5, 1) = "A" And Mid(.Cells(j, "F").Text, 1, 1) = "S" Then .Cells(j, "M").Value = "ANNULATION TECHNIQUE" Else .Cells(j, "M").Value = ""
' End If
If .Cells(j, "Q") = "" And somme < 15000 And (.Cells(j, "H").Value = "002160" Or .Cells(j, "H").Value = "001170" Or .Cells(j, "H").Value = "001121") Then .Cells(j, "M") = "PAS DE DECOMPTE" Else .Cells(j, "M") = "DECOMPTE A EMETTRE"
End If
Next j
End With
pasDeCommentaire:
End Sub |
Partager