Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down List

Status
Not open for further replies.

joliem

Technical User
Aug 25, 2002
1
NZ
In Excel, I want to create a form that has several drop down lists. Is there a way to linked these drop-down list to one another?
 
I am not sure if I am following what you are trying to do but something to try would be to have the first first combobox populate in the activate subroutine for your form. Then create a sub for the on change event for the first combobox it would look something like this:

private sub combobox1_change()
if not isnull(combobox1.value) then
select case combobox1.value
case 1
combobox2.additem ()
'logic to populate based on first option in combobox1
case 2
combobox2.additem ()
' logic to populate based on first option in combobox1
case else
' default logic

end select
combobox2.visible = true
end if
end sub

You can continue with this same logic down through however many comboboxes you need. One obvious application that I can see would be have a list box display the sheets in a workbook, then the next contains two columns, one being the column headings of the selected worksheet, and the second column being the actual column number. Once a value is selected in the second box a third box could give you the specific records in that column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top