Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Combo box source from other workbook

I have a file "File01.xls" with a range "List". This file has a UserForm1
with a ComboBox where the RowSource is range "List". The UserForm is
accessible from any open file. How do I set the RowSource to the "List"
range so it works regardless of the current active workbook. I get an error
when the current active file is not "File01.xls".

Thank you,

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Combo box source from other workbook

Do you want to use the active workbook's List range name or confine it to
one workbook?

If one workbook:

Dim rowSrc As String
rowSrc =
Workbooks("File01.xls").Names("List").RefersToRang e.Address(External:=True)
UserForm1.ComboBox1.RowSource = rowSrc ' Or Me.Combobox1 if the code is in
the userform

or if the active workbook:

Dim rowSrc As String
rowSrc = ActiveWorkbook.Names("List").RefersToRange.Address (External:=True)
UserForm1.ComboBox1.RowSource = rowSrc


--
Tim Zych
http://www.higherdata.com
Workbook Compare - free and pro versions

"Steven" wrote in message
...
I have a file "File01.xls" with a range "List". This file has a UserForm1
with a ComboBox where the RowSource is range "List". The UserForm is
accessible from any open file. How do I set the RowSource to the "List"
range so it works regardless of the current active workbook. I get an
error
when the current active file is not "File01.xls".

Thank you,

Steven



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
Combo Box Data Source Sandy Excel Programming 4 January 22nd 09 04:58 PM
Combo Box row Source art Excel Programming 2 October 19th 08 09:05 PM
Combo Box Row source problem ranswert Excel Programming 2 March 5th 08 08:33 PM
Combo box Row source Richard Excel Programming 2 June 21st 07 09:19 PM
Combo Source from another file Steve Excel Programming 2 August 5th 06 08:32 PM


All times are GMT +1. The time now is 03:42 AM.

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

About Us

"It's about Microsoft Excel"