New to vb, started about 6 months ago and just can't figure this one out. I have two listboxes where the number of items can vary but both will have the same number of items.
Listbox1
Tom
Sue
Henry
Listbox2
Shoes
Hats
Cars
I want to be able to write a line like:
comsave = LB1 & chr(32) & chr(34) & LB2
But the item from lisbox1 (LB1) and the item from listbox2 (LB2) to be at the same index.
I've tried something like this:
for each lb1 as string in listbox1.items
for each lb2 as string in listbox2.items
comsave = LB1 & chr(32) & chr(34) & LB2
But that just gives me the first item in listbox1 as many times as there are items in listbox2, before it goes on to the second item in listbox1, then it repeats.
What I want it to do is loop through all of the items in listbox1, and give the item at the same index in listbox2 for the line:
comsave = LB1 & chr(32) & chr(34) & LB2
I've been reading what I can, but the logic escapes me. Not sure if I need to split it up somehow or use an array maybe. Any help would be appreciated.