probleme avec listbox msg d'erreur

D

damien

Guest
rebonjour à tous
voici ma macro

Private Sub UserForm_Initialize()
TheMatch = UserForm1.ComboBox1
thematch1 = UserForm1.ComboBox2
thematch2 = UserForm1.Label3
thematch3 = UserForm1.Label4
TheMatch4 = UserForm1.Label8
TheMatch5 = UserForm1.Label10
Label2 = TheMatch
Label4 = thematch1
Label7 = thematch2
Label8 = thematch3
Label10 = TheMatch4
Label12 = TheMatch5
Dim C As Range
Dim x, a As Integer

ListBox1.Clear
Sheets('BASE PECHE').Activate
ListBox1.ColumnCount = 20
ListBox1.ColumnWidths = '100;110;110;110;180;120;110;120;100;320;12'
ListBox1.ColumnHeads = True
x = 0
For Each C In Range('f16:r' & Range('A65536').End(xlUp).Row)
If C = Label2 Then
a = C.Row
ListBox1.AddItem
ListBox1.List(x, 0) = Cells(a, 1).Text

ListBox1.List(x, 1) = Cells(a, 3).Text
ListBox1.List(x, 2) = Cells(a, 4).Text
ListBox1.List(x, 3) = Cells(a, 11).Text
ListBox1.List(x, 4) = Cells(a, 12).Text & ' zone ciem ' & Cells(a, 13).Text
ListBox1.List(x, 5) = Cells(a, 14).Text
ListBox1.List(x, 6) = Cells(a, 15).Text
ListBox1.List(x, 7) = Cells(a, 16).Text
ListBox1.List(x, 8) = Cells(a, 17).Text
ListBox1.List(x, 9) = Cells(a, 18).Text
ListBox1.List(x, 10) = Cells(a, 19).Text


x = x + 1
End If
Next C
End Sub
mes probleme les entetes ne s'affiche et si je rejoute la derniere ligne ' ListBox1.List(x, 10) = Cells(a, 19).Text' ça ne marche plus
erreur d'exécution '380':
impossible de définir la propriété list.valeur de propriété non valide

merci dam
 

Discussions similaires

Statistiques des forums

Discussions
312 520
Messages
2 089 281
Membres
104 083
dernier inscrit
hecko