Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default ListBox external source

In the first sheet of my file I have a cell (C3) that accepts input (a
Supplier code) to be validated against an external Excel file table/range
(Column A). Then C4 displays the Supplier name (Column B). I would like to
have this done by a ListBox in order to guide the user to all available
choices.

Please help me set it up since I have never used User forms (???) and such
Control objects in VBA and I have trouble initializing them. I found in the
Help system sample code using a user form but I don't use User Forms, not to
my knowledge anyway. Please bear in mind that the table is external.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ListBox external source

Assume your table/range is in SupplierList.xls on sheet Data, Range:
"A1:B100"

In your sheet,
Select C3 then do

Data=Validation.

You would need to use the List option and set it to

=List1

but do this after you create these names:

after you create a defined name
Insert=Name=Define
Name: List1
RefersTo: =[SupplierList.xls]Data!$A$1:$A$100

and another
Insert=Name=Define
Name: = List2
Refersto: =[SupplierList.xls]Data!$A$1:$B$100

Then in C4 you would have

=if(C3="","",Vlookup(C3,List2,2,False))

SupplierList.xls would need to be open when you use the workbook with these
formulas (at least for the Data=validation to work).

--
Regards,
Tom Ogilvy


"DoctorG" wrote in message
...
In the first sheet of my file I have a cell (C3) that accepts input (a
Supplier code) to be validated against an external Excel file table/range
(Column A). Then C4 displays the Supplier name (Column B). I would like to
have this done by a ListBox in order to guide the user to all available
choices.

Please help me set it up since I have never used User forms (???) and such
Control objects in VBA and I have trouble initializing them. I found in

the
Help system sample code using a user form but I don't use User Forms, not

to
my knowledge anyway. Please bear in mind that the table is external.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ListBox external source


To set up a list for users to select from, on the menu bar, click on
"Data". Then "Validation". Under the settings tab in the "Allow"
window select "List". Under "Source" enter the range of data you want
to be in the list. This will create a pull down menu when the user
activates that cell.

P.S. The list of items needs to be in the same sheet.

Hopefully this will help you.


--
goober
------------------------------------------------------------------------
goober's Profile: http://www.excelforum.com/member.php...o&userid=19838
View this thread: http://www.excelforum.com/showthread...hreadid=480850

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ListBox external source

Hello Tom,
1. I have the same problem, except that on the name of the xls file there
are spaces 'like "this excel sheet.xls". And this seems to be refused by
Excel. How to solve this ?
2. Can we imagine (in term of performance), having a list of 6000 items
coming from another workbook ?

Thanks for your valuable help.

Francois.

"Tom Ogilvy" wrote:

Assume your table/range is in SupplierList.xls on sheet Data, Range:
"A1:B100"

In your sheet,
Select C3 then do

Data=Validation.

You would need to use the List option and set it to

=List1

but do this after you create these names:

after you create a defined name
Insert=Name=Define
Name: List1
RefersTo: =[SupplierList.xls]Data!$A$1:$A$100

and another
Insert=Name=Define
Name: = List2
Refersto: =[SupplierList.xls]Data!$A$1:$B$100

Then in C4 you would have

=if(C3="","",Vlookup(C3,List2,2,False))

SupplierList.xls would need to be open when you use the workbook with these
formulas (at least for the Data=validation to work).

--
Regards,
Tom Ogilvy


"DoctorG" wrote in message
...
In the first sheet of my file I have a cell (C3) that accepts input (a
Supplier code) to be validated against an external Excel file table/range
(Column A). Then C4 displays the Supplier name (Column B). I would like to
have this done by a ListBox in order to guide the user to all available
choices.

Please help me set it up since I have never used User forms (???) and such
Control objects in VBA and I have trouble initializing them. I found in

the
Help system sample code using a user form but I don't use User Forms, not

to
my knowledge anyway. Please bear in mind that the table is external.

Thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 313
Default ListBox external source

what if supplierlist.xls is not open? is there a way to access the data
validation drop down list without opening supplierlist.xls?or any way to
automatically access them in background?

"Tom Ogilvy" wrote:

Assume your table/range is in SupplierList.xls on sheet Data, Range:
"A1:B100"

In your sheet,
Select C3 then do

Data=Validation.

You would need to use the List option and set it to

=List1

but do this after you create these names:

after you create a defined name
Insert=Name=Define
Name: List1
RefersTo: =[SupplierList.xls]Data!$A$1:$A$100

and another
Insert=Name=Define
Name: = List2
Refersto: =[SupplierList.xls]Data!$A$1:$B$100

Then in C4 you would have

=if(C3="","",Vlookup(C3,List2,2,False))

SupplierList.xls would need to be open when you use the workbook with these
formulas (at least for the Data=validation to work).

--
Regards,
Tom Ogilvy


"DoctorG" wrote in message
...
In the first sheet of my file I have a cell (C3) that accepts input (a
Supplier code) to be validated against an external Excel file table/range
(Column A). Then C4 displays the Supplier name (Column B). I would like to
have this done by a ListBox in order to guide the user to all available
choices.

Please help me set it up since I have never used User forms (???) and such
Control objects in VBA and I have trouble initializing them. I found in

the
Help system sample code using a user form but I don't use User Forms, not

to
my knowledge anyway. Please bear in mind that the table is external.

Thanks in advance




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
External data source Question Boy Excel Discussion (Misc queries) 0 April 21st 08 07:44 PM
UNC for external data source Kirk P. Excel Discussion (Misc queries) 0 December 18th 06 04:31 PM
ListBox - Row Source problem unplugs[_39_] Excel Programming 2 July 2nd 04 02:28 AM
ListBox - Row Source problem unplugs[_40_] Excel Programming 0 June 30th 04 05:01 AM
listbox.row source baha[_5_] Excel Programming 1 November 28th 03 08:30 AM


All times are GMT +1. The time now is 04:55 AM.

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"