View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 788
Default Populate combo box with a range

Thanks Guys,

I'm getting runtime errors on both of these...

for FSt1 I tried;
Dim lr As Long
Dim r As Range

lr = Sheets("Sheet1").Cells(5, "A").End(xlUp).Row
Set r = Range("A5:A20" & lr)
Me.cboAudititem.RowSource = "Sheet1!" & r.Address
cmdAdd.SetFocus

I'm using the following Sheets;
Sheet1 (Audit Log)
Sheet2 (Follow Up Actions)
And the range i am looking to populate the Combo with is; A5:A20

I'm a bit lost now to be honest!

Thanks


"Patrick Molloy" wrote:


Private Sub UserForm_Initialize()
With ComboBox1
.RowSource = "Sheet2!B5:B12"
End With
End Sub

"Chris" wrote in message
...
Hi All,

I've built a form in VB and need to populate a combo box with a range from
another sheet in the workbook when I initialize it. I cannot for the life
of
me get the syntax correct.

Any suggestions?

Thanks