Hello. I have this handy piece of code which allows me to multi-select values in a list box, and those multiple values store in a cell as a comma separated string.
The problem is this only seems to work assuming the column you want bound is the same column that the list box shows (in this case column 1). How can I get this code to work if I want the column 1 to show in the list box, but column 2 bound with the list of comma separated values?
Dim s As String, i As Integer
For i = 0 To .ListCount - 1
If .Selected(i) = True Then s = s & .List(i) & ","
If s = vbNullString Then
.Value = vbNullString
.Value = Left(s, Len(s) - 1)
On Error Resume Next
Attached is an Excel file containing the code, list box, and named column range.