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
| Sub CoutMS2()
'
' CoutMS2 Macro
'
'
Set wksEI = Sheets("Extraction Instal")
Set wksEO = Sheets("Extraction OS")
Set wksSC = Sheets("Suivi Coûts MS2")
wksEI.Select
Buf1 = wksEI.Cells(2, 4).Value
Cpt1 = 0
For a = 1 To 60000
If cells(a,18)="IDF" Then
If InStr(Cells(a, 7), "vrac") > 0 Then
If wksEI.Cells(a, 4) <> Buf1 Then
Cpt1 = Cpt1 + 1
Buf1 = wksEI.Cells(a, 4).Value
End If
End If
End If
Next a
wksSC.Cells(8, 2) = Cpt1
wksEI.Select
Buf1 = wksEI.Cells(2, 4).Value
Cpt1 = 0
For a = 1 To 60000
If cells(a,18)="VDR" Then
If InStr(Cells(a, 7), "vrac") > 0 Then
If wksEI.Cells(a, 4) <> Buf1 Then
Cpt1 = Cpt1 + 1
Buf1 = wksEI.Cells(a, 4).Value
End If
End If
End If
Next a
wksSC.Cells(9, 2) = Cpt1 |
Partager