Private Sub remplistbox(donnee As String, £nomfeuille1 As String)
Dim cellule As Range
Dim i As Long
Dim j As Integer
Dim j2 As Integer
Dim j3 As Long
With ListBox1
.Clear
.ColumnCount = 2
.ColumnWidths = .Width & ";0"
End With
With Sheets(£nomfeuille1)
For Each cellule In .Range("a2:a" & .Cells(.Columns(1).Cells.Count, 1).End(xlUp).Row)
If cellule.Value = donnee Then
For i = 2 To 30
If LCase(.Cells(cellule.Row, i)) = "x" Then
If Len(Sheets(£nomfeuille1).Cells(7, i)) > 80 Then
j = 1
j2 = 100
j3 = 100
Do
pos = InStr(j3, .Cells(7, i), " ")
If pos = 0 Then
j2 = Len(Sheets(£nomfeuille1).Cells(7, i)) + 1
Else
j2 = pos - 1
End If
j3 = 80 + j2
Me.ListBox1.AddItem Mid(.Cells(7, i), j, j2 - j + 1)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, Me.ListBox1.ColumnCount - 1) = cellule.Row & "," & i
j = j2 + 1
If j >= Len(Sheets(£nomfeuille1).Cells(7, i)) Then Exit Do
Loop
Me.ListBox1.List(Me.ListBox1.ListCount - 1, Me.ListBox1.ColumnCount - 1) = ""
Me.ListBox1.AddItem " "
Else
Me.ListBox1.AddItem .Cells(7, i)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, Me.ListBox1.ColumnCount - 1) = cellule.Row & "," & i
Me.ListBox1.AddItem " "
Me.ListBox1.List(Me.ListBox1.ListCount - 1, Me.ListBox1.ColumnCount - 1) = ""
End If
End If
Next i
Exit For
End If
Next cellule
End With
End Sub