Bonsoir Walden
Essaye avec ce code
Private Sub CommandButton1_Click()
Dim a As Long ' Variable pour les lignes tjs en long
Dim Quoi As String, TabL() As String
Dim Ind As Integer, FirstLig As Long, LastLig As Long, Lig As Long
Dim LigneAjout As Long
With Me.ListBox1
For i = 0 To .ListCount - 1
If TextBox1 = "" And .Selected(i) = True Then
a = ActiveCell.Row
Range("I" & a).Value = .List(i) ' cas du premier mot pas de ";" avan
End If
If TextBox1 <> "" And .Selected(i) = True Then
a = ActiveCell.Row
LigneAjout = Range("NumLigne").End(xlDown).Row
Quoi = TextBox1.Value
' Séparation par tiret
If InStr(1, Quoi, "-") > 0 Then
FirstLig = Left(Quoi, InStr(1, Quoi, "-") - 1)
LastLig = Mid(Quoi, InStr(1, Quoi, "-") + 1)
For Lig = FirstLig To LastLig
Range("I" & Lig).Value = .List(i)
Next Lig
ElseIf InStr(1, Quoi, ";") > 0 Then
' Séparation par point-virgule
TabL = Split(Quoi, ";")
For Ind = 0 To UBound(TabL)
Range("I" & Val(TabL(Ind))).Value = .List(i)
Next Ind
Else
Range("I" & a).Value = .List(i) ' cas du premier mot pas de ";" avan
End If
End If
Next i
End With
Unload UserForm4
Range("F2").Select
End Sub
A+