PDA

View Full Version : Solved: Two Listboxes



joelsoh
11-14-2008, 07:51 PM
Hi all,

I'm trying to learn VBA at the moment, but I'm not finding it easy at all.
I have a userform, with two listboxes.

The aim is to...
1. Call and display information from one column of a spreadsheet, until an empty space is found, (then stop). This I believe needs some sort of loop. I'm unsure.

2. Have those cells values placed into a listbox.

3. Now they're there, use 4 buttons, "Add one, Remove one, Add all, Remove all", to transfer the values from one listbox to the other.

Any clue?
Thanks!

rbrhodes
11-15-2008, 12:57 AM
Hi Joelsoh,

Oh boy do I know what you're going through right now! I taught myself too.

Here's an example.


-Select any item in listbox 1 and click Add1

-Select any item in Listbox 2 and click Remove1

-Click AddAll to add Listbox1 to 2

-Click Remove all to delete from Listbox 2

etc