Populating combobox from another combobox

  • Thread starter Thread starter David Goodall
  • Start date Start date
D

David Goodall

Hello
I've created, with help, a combobox that lists the sheets in a workbook. I
now want a second combobox to be populated from the contents of a specific
range from the sheet chosen in combobox 1. ie

combobox1 = company names (held in sheet)

combobox2 = above company - employee names held in range(A2:A30)

Again any help is greatly appreciated.

Thanks
David
 
use the click event of the first combobox

Private Sub Combobox1_Click()
Dim sName as String
if Combobox1.ListIndex <> -1 then
sName = Combobox1.Value
Combobox2.RowSource = sName & "!A2:A30"
End if
End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top