bernard_metz
XLDnaute Nouveau
Bonjour à tous,
Je sèche sur ce code:
Private Sub RemplirListBox()
Dim i As Long, col As Long
Dim firstRow As Long, lastRow As Long
Dim val As Variant
firstRow = 13
lastRow = ws.Range("A1") + 13
With Me.DF_LISTE_ELEMENTS
.RowSource = ""
.Clear
.ColumnCount = 16
.ColumnWidths = "40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40"
For i = firstRow To lastRow
If ws.Cells(i, 2).Value = Critere_1 Then
.AddItem ""
For col = 0 To 9
.List(.ListCount - 1, col) = ws.Cells(i, col + 1).Value
Next col
.List(.ListCount - 1, col) = "ok"
End If
Next i
End With
End Sub
Dès que je veux écrire quelque chose dans le colonne 10 j'ai une erreur 380
Je sèche sur ce code:
Private Sub RemplirListBox()
Dim i As Long, col As Long
Dim firstRow As Long, lastRow As Long
Dim val As Variant
firstRow = 13
lastRow = ws.Range("A1") + 13
With Me.DF_LISTE_ELEMENTS
.RowSource = ""
.Clear
.ColumnCount = 16
.ColumnWidths = "40;40;40;40;40;40;40;40;40;40;40;40;40;40;40;40"
For i = firstRow To lastRow
If ws.Cells(i, 2).Value = Critere_1 Then
.AddItem ""
For col = 0 To 9
.List(.ListCount - 1, col) = ws.Cells(i, col + 1).Value
Next col
.List(.ListCount - 1, col) = "ok"
End If
Next i
End With
End Sub
Dès que je veux écrire quelque chose dans le colonne 10 j'ai une erreur 380