Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Populating a dropdown list with an Array

I am using data from a separate worksheet as a look-up for
the data entry on a primary sheet. After a part no. is
entered I'd like the dropdown list for the possible serial
numbers to be populated by an array. Of course the serial
numbers are different and a specific part no. could have 1
to N serial numbers associated with it.

1. Doing the search is not a problem
2. Determining the indeterminate range of values and
loading it in the array may give me some difficultly -
suggestions or where to look would be appreciated.

3. Loading a dropdown list is definitely where I may
lack the adequate syntax and knowledge.


I found an example of populating a User's Form listbox on
the support page, but I am not certain it is a possibility.

Thanks for any help.

MC

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Populating a dropdown list with an Array



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"MC" wrote in message
...
I am using data from a separate worksheet as a look-up for
the data entry on a primary sheet. After a part no. is
entered I'd like the dropdown list for the possible serial
numbers to be populated by an array. Of course the serial
numbers are different and a specific part no. could have 1
to N serial numbers associated with it.

1. Doing the search is not a problem
2. Determining the indeterminate range of values and
loading it in the array may give me some difficultly -
suggestions or where to look would be appreciated.

3. Loading a dropdown list is definitely where I may
lack the adequate syntax and knowledge.


I found an example of populating a User's Form listbox on
the support page, but I am not certain it is a possibility.

Thanks for any help.

MC



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Populating a dropdown list with an Array

The answer would depend upon how the data is formatted and what DD you are
using (a userform, a worksheet forms DD, Data Validation, or worksheet
control).

Give us the details.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"MC" wrote in message
...
I am using data from a separate worksheet as a look-up for
the data entry on a primary sheet. After a part no. is
entered I'd like the dropdown list for the possible serial
numbers to be populated by an array. Of course the serial
numbers are different and a specific part no. could have 1
to N serial numbers associated with it.

1. Doing the search is not a problem
2. Determining the indeterminate range of values and
loading it in the array may give me some difficultly -
suggestions or where to look would be appreciated.

3. Loading a dropdown list is definitely where I may
lack the adequate syntax and knowledge.


I found an example of populating a User's Form listbox on
the support page, but I am not certain it is a possibility.

Thanks for any help.

MC



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Populating a dropdown list with an Array

for each cell in Worksheets("Data").Range("A1:A5000")
if cell.Value = Worksheets("sheet1").Range("C1").Value then
Worksheets("sheet1").Listbox1.AddItem cell.offset(0,1).value
end if
Next

would be one possibility. if you want to build an array

Dim Myarray()
num = Application.Countif(rksheets("Data").Range("A1:A50 00"), _
Worksheets("sheet1").Range("C1").Value)

Redim MyArray(1 to num)
j = 0
for each cell in Worksheets("Data").Range("A1:A5000")
if cell.Value = Worksheets("Sheet1").Range("C1").Value then
j = j + 1
myarray(j) = cell.offset(0,1).value
end if
Next
Worksheets("Sheet1").Listbox1.List = myArray

--
Regards,
Tom Ogilvy


"MC" wrote in message
...
I am using data from a separate worksheet as a look-up for
the data entry on a primary sheet. After a part no. is
entered I'd like the dropdown list for the possible serial
numbers to be populated by an array. Of course the serial
numbers are different and a specific part no. could have 1
to N serial numbers associated with it.

1. Doing the search is not a problem
2. Determining the indeterminate range of values and
loading it in the array may give me some difficultly -
suggestions or where to look would be appreciated.

3. Loading a dropdown list is definitely where I may
lack the adequate syntax and knowledge.


I found an example of populating a User's Form listbox on
the support page, but I am not certain it is a possibility.

Thanks for any help.

MC



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
dropdown lists and populating new table based on the selection Herbert Seidenberg Excel Discussion (Misc queries) 1 November 26th 08 05:54 AM
Populating an array Bucs85027 Excel Worksheet Functions 0 February 14th 08 12:32 AM
Formula not populating from dropdown box.Works when entered manua Grandmother of 2 Excel Worksheet Functions 2 January 1st 07 03:46 PM
populating DropDown with Values Of a Column in another Sheet. ZarrinPour Excel Discussion (Misc queries) 7 March 12th 06 02:51 PM
Populating a 2-D array Hotbird[_2_] Excel Programming 8 February 7th 04 05:25 PM


All times are GMT +1. The time now is 10:37 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"