Hi, I am new to VBA and I really need some help. I am basically trying to do the following steps:
I want to doubleclick on a cell which opens a Listbox. From this Listbox I can select multiple items (which I manage on another sheet) and add multiple items to my cell (which are seperated by commas)
This is my code so far but I don't really know how to tell my listbox to add items to the cell I am clicking on.
Option Explicit
Private Sub ListBox1_Click()
End Sub
Private Sub CommandButton1_Click()
Worksheets("Tabelle1").Activate
Dim i As Integer
With UserForm1.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
MsgBox .List(i) 'Gebe die ausgewählten Elemente aus
ActiveSheet.Cells=3 .Value = .List(i)
Else
'Nichts passiert
End If
Next i
End With
End Sub
Private Sub UserForm_Initialize()
Worksheets("Tätigkeiten").Activate
UserForm1.ListBox1.RowSource = "A1:A31"
ListBox1.ListStyle = fmListStyleOption
End Sub
Bookmarks