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 Liste_Article()
Dim i, j As Integer
On Error Resume Next
i = 0
ThisWorkbook.Worksheets(Feuille_Données).Range("A1:K" & ThisWorkbook.Worksheets(Feuille_Données).Range(Split(Cells(1, 4).Address(1, 0), "$")(0) & "65000").End(xlUp).Row).Sort Key1:=ThisWorkbook.Worksheets(Feuille_Données).Range("B2"), Order1:=xlAscending, Key2:=ThisWorkbook.Worksheets(Feuille_Données).Range("D2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
''##### MISE A JOUR DE LA ZONE DEROULANTE NOM ARTICLES EXISTANTS #####
For j = 2 To ThisWorkbook.Worksheets(Feuille_Données).Range(Split(Cells(1, 4).Address(1, 0), "$")(0) & "65000").End(xlUp).Row
ART_STK.AddItem ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 2), i
ART_STK.List(i, 1) = ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 4)
ART_STK.List(i, 2) = ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 3)
ART_STK.List(i, 3) = ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 5)
ART_STK.List(i, 4) = ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 10)
ART_STK.List(i, 5) = ThisWorkbook.Worksheets(Feuille_Données).Cells(j, 1)
'Mise en couleur des articles standard'
If ART_STK.List(i, 5) = "STAND" Then
ART_STK.Rows(i).Interior.ColorIndex = 20
End If
i = i + 1
Next j
'LISTE STOCK = 1/ Famille 2/Désignation 3/Référence 4/Unité 5/Prix
ART_STK.ListIndex = 0
End Sub |
Partager