I have a multicolumn listbox in my userform and I would like to get all the values of the elements which are in the selected row in the listbox.
Here is my userform:
With a single column you can retrieve the value as below:
Dim str as String
str = me.ListBox1.Value
With a multicolumn you can retrieve the value like this:
Dim strCol1 as String
Dim strCol2 as String
Dim strCol3 as String
strCol1 = ListBox1.List(0, 1)
strCol2 = ListBox1.List(0, 2)
strCol3 = ListBox1.List(0, 3)
or you can add all the data into 1 String:
Dim strColumns as String
strColumns = ListBox1.List(0, 1) + " " + ListBox1.List(0, 2) + " " + ListBox1.List(0, 3)