Multicolumn Listbox with variable range
If you use the rowsource property it should update each time the sheet
calculates or a cel is edited.
Private Sub Userform_Initialize()
Dim rng as Range
Listbox1.ColumnCount = 2
With Worksheets("Sheet1")
set rng = .Range(.Range("A2"), _
.Cells(rows.count,1).End(xlup)) _
.Resize(,2)
End With
ListBox1.RowSource = rng.Address(External:=True)
End Sub
--
Regards,
Tom Ogilvy
"dht" wrote in message
...
I'm trying to create a listbox in a user form (C_Panel) that is
multicolumn,
and references a two column but variable row range (A2 to B?). Can someone
point me to how to do this.
Also how do I get the listbox to automatically reflect any changes to the
range or does it do it automatically?
Using Excel 2000
Thanks
David
|