Multiselect listbox saving selections (1 Viewer)

Kempes

Registered User.
Local time
Today, 09:21
Joined
Oct 7, 2004
Messages
327
Hi all,

I have a listbox set to multiselect.

When users select one or more options and saves the spreadsheet, they are no longer selected when re-opening the spreadsheet.

How do I get excel to remember what options were chosen when saving and re-opening?

Many thanks
Kempes
 

Kempes

Registered User.
Local time
Today, 09:21
Joined
Oct 7, 2004
Messages
327
sussed it,

For anyone else struggling with this issue....

I have this code in now that saves their selection to coumn P.

Dim i As Long
Dim v As Long

v = 0

For i = 0 To Me.listbox1.ListCount - 1
ThisWorkbook.Sheets(1).Range("P" & v + 1) = Me.listbox1.Selected(i)
v = v + 1
Next i

Then, in the workbook open event,

Dim i As Long
Dim v As Long

v = 0

For i = 0 To Me.listbox1.ListCount - 1
Me.listbox1.Selected(i) = ThisWorkbook.Sheets(1).Range("P" & v + 1)
v = v + 1
Next i
 

Users who are viewing this thread

Top Bottom