Bonjour,
j'utilise un useform de liste déroulante à sélection multiple qui s'affichent sur une cellule que j'ai choisi. Jusqu'a là sa va. Maintenant je souhaite appliquer mes choix à plusieurs cellules (un choix, une cellule et non tous les choix dans la même cellule. Quelqu'un sait comment faire?
Voici mon code pour mon useform
Option Explicit
Private Sub CommandButton1_Click()
Dim i As Byte
Dim ValeurARetourner As String
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
ValeurARetourner = ValeurARetourner & ListBox1.List(i) & " & "
End If
Next i
With Sheets("Field")
.Range("A3") = Left(ValeurARetourner, Len(ValeurARetourner) - 3)
.Range("B3").Activate
End With
UserForm1.Hide
Unload UserForm1
End Sub
Private Sub UserForm_Initialize()
Dim i As Integer, Derlig As Integer
ListBox1.Clear
Derlig = Sheets("Field").Cells(65536, 21).End(xlUp).Row
For i = 1 To Derlig
ListBox1.AddItem Cells(i, 21).Value
Next i
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
ListBox1.Selected(i) = False
Ici c'est la cellule choisie pour afficher les choix:
.Range("A3") = Left(ValeurARetourner, Len(ValeurARetourner) - 3)
et je voudrais que chaque choix de ma liste déroulante soit affiché dans des differentes cellules à la suite A3,A4,A5,A6....
Help