Userform w/ Multiple listboxes that link

M

miker1999

Hello,
I am now about to experiment into the wonderful world o
Userforms....and I'm nervous.

Currently, I have the validation set up on 2 columns that link. Th
first column is Department and the second column only shows Position
available in what was selected in Department. I use VLOOK t
accomplish this (=INDIRECT(VLOOKUP(F4,DeptLookUp,2,0))....F4=Departmen
selected...

I have the first listbox with RowSource = Department. How do I lin
this to the second listbox and only populate and list the Positions fo
that Department? Is this possible?

Thanks a bunch
 
B

Bob Flanagan

Mike, double click on the first listbox. That will put you in the userform
code module and the listbox click event. Then in the right hand dropdown,
select the change event. In the change event procedure write statements
that would populate the second listbox based on the selection in the first
listbox. Most likely you should do a listbox Clear statement before
populating. I have found it best to use the AddItem approach to populate
listboxes versus specifying a source range.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
M

miker1999

Bob,
Thanks for the reply. I am with you up until the part where I shoul
'write statements that would populate the second list box.' Can yo
give me an idea on that?
Thanks,
Mik
 
Top