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
|
Private Sub CommandButton2_Click()
'Remettre à blanc les cellules
Worksheets("recapitulatif").Range("a1", "f700").Interior.Color = RGB(255, 255, 255)
'Epurer la sélection des localisations
Range("f2", "f800").ClearContents
'Epurer la somme des emplacements sélectionnés et à éditer
Range("L2", "L9").ClearContents
'Epurer la liste des articles pour copie des doublons
Range("Z1", "Z500").ClearContents
'Epurer la liste des doublons
Range("i24", "k50").ClearContents
'Epurer les articles sélectionnés
Worksheets("Liste Comp Inventaire").Range("a1", "O8000").ClearContents
Worksheets("Liste Comp Inventaire").Range("a1", "O8000").Interior.Color = RGB(255, 255, 255)
'Ne garder que les 3 premiers trigrammes
C6 = 10
L6 = 5
For i = 1 To 5
Worksheets("recapitulatif").Cells(L6, C6) = "-"
L6 = L6 + 1
Next
If Worksheets("recapitulatif").Range("j3") = "" Then
Worksheets("recapitulatif").Range("j3") = "-"
End If
If Worksheets("recapitulatif").Range("j4") = "" Then
Worksheets("recapitulatif").Range("j4") = "-"
End If
'Colorier de jaune les localisations entammées
C2 = 5
l2 = 2
For h = 1 To 700
If Worksheets("recapitulatif").Cells(l2, C2 - 1) <> "" Then
Worksheets("recapitulatif").Cells(l2, C2).Interior.Color = RGB(255, 255, 153)
End If
l2 = l2 + 1
Next
'Colorier de gris les localisations comptés entièrement
C1 = 5
l1 = 2
For y = 1 To 700
If Worksheets("recapitulatif").Cells(l1, C1) <= 0 Then
Worksheets("recapitulatif").Cells(l1, C1).Interior.Color = RGB(192, 192, 192)
Worksheets("recapitulatif").Cells(l1, C1 + 1).Interior.Color = RGB(192, 192, 192)
Worksheets("recapitulatif").Cells(l1, C1 - 1).Interior.Color = RGB(192, 192, 192)
Worksheets("recapitulatif").Cells(l1, C1 - 2).Interior.Color = RGB(192, 192, 192)
Worksheets("recapitulatif").Cells(l1, C1 - 3).Interior.Color = RGB(192, 192, 192)
Worksheets("recapitulatif").Cells(l1, C1 - 4).Interior.Color = RGB(192, 192, 192)
End If
l1 = l1 + 1
Next
End Sub |
Partager