Rowsource from another workbook

  • Thread starter Thread starter ranswrt
  • Start date Start date
R

ranswrt

I have a workbook that I am using to create estimates on. I have another
workbook that contains the databases for the estimates. How do I set a
listbox rowsource from different workbook than the form with the listbox is
in?
Thanks
 
Maybe:
[OtherWorkbook.xls]Sheet1!a1:f25

Or if the wb name is two or more words:

'[Other Workbook.xls]Sheet1'!a1:f25
 
How do I do this when the range for the rowsource is named? The name I am
using is 'wrkshtrng'.
JLGWhiz said:
Maybe:
[OtherWorkbook.xls]Sheet1!a1:f25

Or if the wb name is two or more words:

'[Other Workbook.xls]Sheet1'!a1:f25

ranswrt said:
I have a workbook that I am using to create estimates on. I have another
workbook that contains the databases for the estimates. How do I set a
listbox rowsource from different workbook than the form with the listbox is
in?
Thanks
 
I like to let Excel create it for me.

Dim rng as Range, RowSrc as String
Set rng =
Workbooks("SomeBook.xls").Worksheets("SomeSheet").Range("ListRange")
RowSrc = rng.address(External:=True)

or if it's a book-level range name

Dim rng as Range, RowSrc as String
Set rng = Workbooks("SomeBook.xls").Names("ListRange").RefersToRange
RowSrc = rng.Address(External:=True)


--
Tim Zych
www.higherdata.com
Compare data in Excel and find differences with Workbook Compare
A free, powerful, flexible Excel utility
Now with Table Compare for quick table comparisons
 
That worked great Thank You

Tim Zych said:
I like to let Excel create it for me.

Dim rng as Range, RowSrc as String
Set rng =
Workbooks("SomeBook.xls").Worksheets("SomeSheet").Range("ListRange")
RowSrc = rng.address(External:=True)

or if it's a book-level range name

Dim rng as Range, RowSrc as String
Set rng = Workbooks("SomeBook.xls").Names("ListRange").RefersToRange
RowSrc = rng.Address(External:=True)


--
Tim Zych
www.higherdata.com
Compare data in Excel and find differences with Workbook Compare
A free, powerful, flexible Excel utility
Now with Table Compare for quick table comparisons
 

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