combo box control source

P

paula

I need to use a named range for the control source for a combo box in a
userform. is that possible, and if so, how!

thanks!
 
D

Dave Peterson

Option Explicit
Private Sub UserForm_Initialize()
With Me.ComboBox1
.ControlSource = ActiveWorkbook.Worksheets("sheet9999") _
.Range("somenamedrangehere").Address(external:=True)
End With
End Sub

Adjust the sheetname and range name to what you need.
 
N

Nigel

ComboBox1.RowSource = "MyRangeName"

or if named range is sheet specific

ComboBox1.RowSource = "Sheet1!MyRangeName"
 
N

Nigel

Oops! sorry misread row for control - but maybe that is what you want?

--

Regards,
Nigel
(e-mail address removed)
 

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

Top