Following is the issue: 1) I force some Items to be selected in a ListBox over VBA Code 2) Open UserForm and select or deselect some Items. (everything seems fine in the ListBox) 3) Write the selected Items out. If i only select some new items, everyhing works fine. If i deselect a selected item, which i forced at the beginning to be selected, it is still selected in the output.
With Sheets("ID_Mitarbeiter").Range("A2:A1048576")
Set c = .Find(What:=TextBox_ID, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
ListBox_Mitarbeiter.Selected(Sheets("ID_Mitarbeiter").Cells(c.Row, 2) - 1) = True
Set c = .FindNext(c)
If c Is Nothing Then
GoTo DoneFinding
End If
Loop While c.Address <> firstAddress
End If
DoneFinding: End With