Help with populating new combobox with list of ranges

C

Chris

I need to populate a new combobox with a list of ranges. I have one
combobox that works with one range "Main" but I have 4 other ranges on
the worksheet that I need to inlcude. So for example, I will choose the
range "Main" with one combobox and the data from the rowsources will
show up on the userform text box part. Is there a simple way to add a
second combobox for the additional ranges ? Here is my current code
below: Assuming I can get some guidance, I will be creating a second
combobox for the ranges.. thanks for any help..

Private Sub ComboBox1_Change()
'If we're initialize then all txt boxes are blank, don't write
If Not Initialize Then
SaveRow
End If

'Set current row
lCurrentRow = ComboBox1.ListIndex + 6

'LoadRow based off new current row
LoadRow
'Load TextBoxes
Set rng = Range(Range("Main").Offset(3), _
Range("Main").Offset(3).End(xlDown))
'Range(ComboBox1.RowSource)
txtReqNum.Text = rng(ComboBox1.ListIndex + 1)(1, 1)
txtDateOpen.Text = rng(ComboBox1.ListIndex + 1)(1, 2)
txtType.Text = rng(ComboBox1.ListIndex + 1)(1, 4)
txtPriority.Text = rng(ComboBox1.ListIndex + 1)(1, 5)
txtTitle.Text = rng(ComboBox1.ListIndex + 1)(1, 6)
txtGrd.Text = rng(ComboBox1.ListIndex + 1)(1, 7)
txtExpected.Text = rng(ComboBox1.ListIndex + 1)(1, 10)
txtNR.Text = rng(ComboBox1.ListIndex + 1)(1, 11)
txtManager.Text = rng(ComboBox1.ListIndex + 1)(1, 12)
txtDept.Text = rng(ComboBox1.ListIndex + 1)(1, 13)
txtRecr.Text = rng(ComboBox1.ListIndex + 1)(1, 14)
txtStatus.Text = rng(ComboBox1.ListIndex + 1)(1, 15)
txtCandidate.Text = rng(ComboBox1.ListIndex + 1)(1, 16)
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

Similar Threads


Top