DataSource for ComboBox in UserForm

  • Thread starter Thread starter Stuart Grant
  • Start date Start date
S

Stuart Grant

I have a user form in a worksheet with several text boxes and a combobox. I
cannot find how to make the data source of the combobox a column in another
worksheet.
John Walkenbach's Excel 2003 Bible say that a combobox in a userform has a
ListFillRange but it doesn't seem to have - only Data Source.
I tried putting "=Trandesc!Range("A1:A66") as the Data Source but this gives
an error message.
Can someone put me right ?
Stuart
 
It's really a userform, right?

If yes, then look for .rowsource in the properties window.
And use: trandesc!a1:a66

You can also do it in code:
 
It's really a userform, right?

If yes, then look for .rowsource in the properties window.
And use: trandesc!a1:a66

You can also do it in code:

Option Explicit
Private Sub UserForm_Initialize()
With Me.ComboBox1
.RowSource = "" 'in case you didn't clear the properties window
.RowSource = ThisWorkbook.Worksheets("Trandesc") _
.Range("a1:a66").Address(external:=True)
End Sub
 
Back
Top