Populating combobox from another combobox

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
 
T

Tom Ogilvy

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
 
Top