When do I need Rng.Address(External:=True)

  • Thread starter Thread starter davidm
  • Start date Start date
D

davidm

I have created an Addin that contains a ListBox populated by a rowsourc
reference.
The Excel file component of the addin works fine but somehow th
Listbox fails to load up in its Addin enviroment. The relevant part o
the code reads:


ListBox1.RowSource="ef2:em" & [em65536].End(xlUp).Row

I vaguely sense this may be a classical case wher
Address(External:-True) may be required but I have lost my way a bit.

Thanks for any help.


Davi
 
your code will take the range from the activeworkbook.

better to do like:

Private Sub UserForm_Initialize()
With ThisWorkbook.Sheets(3).Columns("EF")
Me.ComboBox1.RowSource = Range( _
.Cells(2), _
.Cells(Rows.Count).End(xlUp) _
).Address(external:=True)
End With
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


davidm wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top