Dim i, j As Integer
For i =0 To listbox1.ColumnCount
For j = 0 To 2
listbox2.Cell(listBox2.LastIndex,j) = listbox1.Cell(listBox2.LastIndex,j)
But is is possible to do this in one step?
I thought the ListBox.dataField would grab the all the data in one fell swoop, but that’s not the case.
What I’d really like to do is move the entire contents of a listbox into a string, (so I could save everything in one block), and then later load that string back, to restore the original populated state of the listBox
Considering how the listBox.initialValue is a text block, I thought maybe the listBox.dataField might work.
Got it. (These objects just have a maze of properties.)
This converts the entire listBox to Text, then loads the text back again.
Dim temp As String
temp = listbox1.Cell(-1, -1).ToText //saves as text
MsgBox(temp) //displays Text
listbox1.Cell(-1, -1) = "" //clears text
listbox1.Cell(-1, -1) = temp //loads text back
MsgBox ("Back Again")