G
Guest
I use the following to populate a combobox on a form - Data is not bound.
Private driver() as String, tbl as Range, i as Integer
Private Sub UserForm_Initialize()
Set tbl = Sheets(3).Range("C1").CurrentRegion.Offset(1, 0)
ReDim driver(0 To tbl.Rows.Count - 2)
For i = 0 To tbl.Rows.Count - 2
driver(i) = Sheets(3).Cells(i + 2, 3)
Next i
cboDriver.List() = driver
End Sub
1. I would like to set the RowSource property in Properties but cannot find
the right syntax. What should this be?
2. Which way is 'more correct', setting this from the Properties Dialog or
in the Initialize Event?
Geoff
Private driver() as String, tbl as Range, i as Integer
Private Sub UserForm_Initialize()
Set tbl = Sheets(3).Range("C1").CurrentRegion.Offset(1, 0)
ReDim driver(0 To tbl.Rows.Count - 2)
For i = 0 To tbl.Rows.Count - 2
driver(i) = Sheets(3).Cells(i + 2, 3)
Next i
cboDriver.List() = driver
End Sub
1. I would like to set the RowSource property in Properties but cannot find
the right syntax. What should this be?
2. Which way is 'more correct', setting this from the Properties Dialog or
in the Initialize Event?
Geoff