Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default listbox rowsource from wrong workbook

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("E 5:e184").Address(External
= True)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default listbox rowsource from wrong workbook

Is it as simple as missing a colon:

ufRemList.lbTailNum.RowSource _
= Workbooks("WB1.xls").Worksheets("Sheet3").Range("E 5: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???



David Sisson wrote:

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("E 5:e184").Address(External
= True)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default listbox rowsource from wrong workbook

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox rowsource on Userform Wendy Excel Discussion (Misc queries) 6 February 28th 08 05:46 PM
???Help??? Userform.Listbox.rowsource = ??? Steve Sparti Excel Discussion (Misc queries) 0 March 1st 06 09:44 PM
RowSource in ListBox aet-inc[_2_] Excel Programming 1 December 3rd 03 12:41 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
listbox rowsource Christy[_2_] Excel Programming 4 September 20th 03 11:44 PM


All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"