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"
 
Top