bonjour les amis, je viens vous voir car j'ai un petit probleme dans mon code et je ne comprend pas trop pourquoi ca ne marche pas.


je souhaiterais que si l'année marque en cellule Cells(i, 1) = à celle en cours et que la cellule i,2 et celle du mois en cours alors ca affiche dans la liste box. mais la ca ne me fait rien, je ne comprend pas pourquoi ?
de plus, quand je laisse juste le code avec le "year(now), j'ai une erreur en dessous : impossible de définir la propriété list.index de table de propriété non valide
alors que si j'enleve la condition si, la boucle marche bien.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Private Sub appel_vrac()
 
planing.Clear
planing.ColumnCount = 6
i = 4
j = 0
 
planing.AddItem
planing.List(j, 0) = "Nom du produit"
planing.List(j, 1) = "Catégorie"
planing.List(j, 2) = "N°of/code"
planing.List(j, 3) = "N°de lot/N° de caisse"
planing.List(j, 4) = "Date de dégustation"
planing.List(j, 5) = "date d'entrée"
 
 
j = j + 1
 
Do While Worksheets("planification vrac").Cells(i, 1) <> ""
   'If Worksheets("planification vrac").Cells(i, 1) = Year(Now) Then 'And Worksheets("planification vrac").Cells(i, 2) = Month(Now) Then
    planing.AddItem
    planing.List(j, 0) = Worksheets("planification vrac").Cells(i, 5)
    planing.List(j, 1) = Worksheets("planification vrac").Cells(i, 6)
    planing.List(j, 2) = Worksheets("planification vrac").Cells(i, 4)
    planing.List(j, 3) = Worksheets("planification vrac").Cells(i, 8)
    planing.List(j, 4) = Worksheets("planification vrac").Cells(i, 3)
    planing.List(j, 5) = Worksheets("planification vrac").Cells(i, 9)
    'End If
    j = j + 1
i = i + 1
Loop
End Sub
Merci pour vos réponse
gipn