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
|
Dim reference As Integer
Dim index_entree As Integer
Dim tableau_entree() As Variant
Dim tableau_sortie() As Variant
Application.ScreenUpdating = False
With Sheets("pg")
reference = .Range("x59").Value
tableau_entree = .Range("z56:z59").Value
ReDim tableau_sortie(LBound(tableau_entree) To UBound(tableau_entree))
reference = .Range("x59").Value
tableau_entree = .Range("z56:z59").Value
ReDim tableau_sortie(LBound(tableau_entree) To UBound(tableau_entree))
index_entree = LBound(tableau_entree)
If reference = 1 And tableau_entree(index_entree, 1) = 1 Then
tableau_sortie(index_entree) = 2
Else
tableau_sortie(index_entree) = 0
End If
If reference = 1 And tableau_entree(index_entree + 1, 1) = 1 Then
tableau_sortie(index_entree + 1) = 2
Else
tableau_sortie(index_entree + 1) = 0
End If
If reference = 1 And tableau_entree(index_entree + 2, 1) = 1 Then
tableau_sortie(index_entree + 2) = 3
Else
tableau_sortie(index_entree + 2) = 0
End If
If reference = 1 And tableau_entree(index_entree + 3, 1) = 1 Then
tableau_sortie(index_entree + 3) = 3
Else
tableau_sortie(index_entree + 3) = 0
End If
.Range("am56:ap56").Value = tableau_sortie
End With
End With
Application.ScreenUpdating = True |