Hi
I have found this code on the net
This code work perfect when I use it, I have an save button that I use the code and in one cell it save what I have selected in the listbox.
My problem are, when I open my userform and the product that I have saved I like also the listbox to fill out what have been saved in the cell.
Ex: if the listbox have
Product 1
Product 2
Product 3
I have selcted Produkt 1 and 2 and I have saved.
Now in my sheet and the cell it will be: Product 1,Product 2
I now open my userform and I will now fill the listbox with the information that are saved in the cell.
Hope someone understand what I mean here
I have found this code on the net
Code:
Dim arrItems()
Dim cnt As Long
Dim I As Long
For I = 0 To ListGateWay.ListCount - 1
If ListGateWay.Selected(I) Then
ReDim Preserve arrItems(cnt)
arrItems(cnt) = ListGateWay.List(I)
cnt = cnt + 1
End If
Next I
If cnt > 0 Then
ws.Cells(LastRow + 1, "U").Value = Join(arrItems, ",")
End If
This code work perfect when I use it, I have an save button that I use the code and in one cell it save what I have selected in the listbox.
My problem are, when I open my userform and the product that I have saved I like also the listbox to fill out what have been saved in the cell.
Ex: if the listbox have
Product 1
Product 2
Product 3
I have selcted Produkt 1 and 2 and I have saved.
Now in my sheet and the cell it will be: Product 1,Product 2
I now open my userform and I will now fill the listbox with the information that are saved in the cell.
Hope someone understand what I mean here