listbox rowsource from wrong workbook

D

David Sisson

I have two workbooks open at the same time.

The macros are running from WB1 and processing info to and from WB2.

In WB1, I have a userform with a listbox. In the initialize sub of the
userform, I use rowsource to populate listbox from a Sheet located in
WB1. I have a fully qualified path to range.

The problem is that rowsource uses data from WB2, not WB1, to populate
listbox.

Here is the line of code from initialize sub.
ufRemList.lbTailNum.RowSource =
Workbooks("WB1.xls").Worksheets("Sheet3").Range("E5:e184").Address(External
= True)
 
D

Dave Peterson

Is it as simple as missing a colon:

ufRemList.lbTailNum.RowSource _
= Workbooks("WB1.xls").Worksheets("Sheet3").Range("E5:e184") _
.Address(External:=True)

(External:=true)

And I'm confused about WB1 and WB2. In your text, you say you want to pick up
the list from WB2, but in the code you use WB1.

One of these things is not like the other???
 
D

David Sisson

Is it as simple as missing a colon:

Ugghh! That was it! Couldn't see the acorn for the forest. :)
And I'm confused about WB1 and WB2. In your text, you say you want to pick up
the list from WB2, but in the code you use WB1.

No. That was the problem. It was picking up data from WB2, and I
wanted it from WB1.

Thanks!
 

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

Top