UserForms with pre-defined Ranges

eggyboy79
04-24-2008, 10:13 AM
Hi everyone!

I'm fairly new to the whole VB thing but i've got a problem so this is the first place i decided to go... :D

What i've got at the moment is a spreadsheet that display a series of issues and the tests that they are linked to (see zipped attachment).

What I want to do is create a userform that has two ListBoxes. So that when an Issue is selected in the first list box the tests that it is linked to appear in the second list box.

For example with the attachment. User selects Issue 1 (in the first list box)and Tests 1 & Test 2 are displayed in the second list box, and where possible reverse the process.

Anyone got any ideas how i can write this in VB. Preferably so that it can also be exported to a grid or somewhere :confused:

Any help will be much appreciated!



Please post Excel questions, in the Excel forum.

Thank you.

Timbo
04-25-2008, 09:30 AM
I think the easiest option for you would be to save the lists in a hidden spreadsheet. There you can apply filters to them, copy the result to another range, return an array from the range, then assign that array to the 'List' property of your ListBox.

Another approach might be to maintain your lists in ADO Stream objects, and convert them to recordsets for filtering, before returning the result sets to the ListBoxes.

Either way, I think you'll need to read a few topics in your VB help! Post back with your code if you get stuck :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum