RE: Drop Down List

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

Assuming you mean UserForm when you say form -

If you want the userform to pick up the unique items from the csv file you
should open the file first, although it may be possible to do it from a
closed file it's going to require much fancier coding. Second, the
description at the contextures site probably won't really address the details
of your problem, it is an overview of data validation.

What you need to do is have your code produce a list of unique entries from
each of the appropriate fields from the incoming csv file. You can record
much of that, after which you can show the code here at the newsgroup and ask
for help modifying it. I would consider recording the command Data, Filter,
Advanced Filter, Unique records command, one at a time for each of the fields
you will want to have lists for. Next I would record the naming of each of
these list. And that is the name I would use as the Row Source for each of
the combo boxes on the user form.

Even if by "form" you don't mean user form, you can still use the above idea
to create unique lists for Data, Validation Lists. In that case you use the
name of the ranges in the Source box for the List option. To create a unique
list you can manually use the Data, Filter, Advanced Filter, Unique records
command. Suppose you open the csv file and there are three fields you want
to provide drop downs for - select one of those columns with its title and
choose Data, Filter, Advanced Filter, turn on Copy to another location, make
sure the List range is the one you highlighted, leave the Criteria empty, in
the Copy to box select the top cell where you want the unique list to be
placed, check Unique records only and click OK. Repeat this for each column
for which you want a pick list. Then proceed with the Data, Validation
command described at the contexture website.

One question - why not turn on AutoFilters for the incoming csv data? It
might be easier. But that's just a thought.

If this helps, click the Yes button.
--
Thanks,
Shane Devenshire


"klafert" wrote:

I am creating a form in Excel and need a drop down list. The data is coming
from another file. Actual an export from another program, a .csv file. I
may be updated now and then. How do I create a drop down box so, I can
choose entries from the .csv. I will have two possible three. Most I will
choose one choice, like customer names, but on choice will be a ship to
address. So, it will pull up a whole address.
.



Relevant Pages

  • Re: Excel Sorting - Finding Duplicate Entries
    ... Bring the two lists into one worksheet, copy list from one to the end of the other. ... In xl2003 you will find advanced filter in the data menu, the list range is ALL of your names list, leave criteria empty, click 'Copy to another location' (has to be on same worksheet), choose a suitable, click 'Unique records only' and press OK. ...
    (microsoft.public.excel.programming)
  • Re: list of entries from a column without duplicates
    ... Advanced Filter can be used to generate a list of unique values. ... 'Unique records only'. ... I would like to create a list of all materials ... tried lists but I can get one material at a time or all of them. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison
    ... You have a CSV file of about 520 MiB, which is read into memory. ... if not chunk: break ... Python lists are not particularly ...
    (comp.lang.python)
  • Re: Address book
    ... I thought that sharing of address book between OL and OE would be very ... It now seems that I should have two separate contact lists between OE and ... Roman King wrote: ... Export your OL contacts as a CSV file. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Global Address List
    ... To export client's contacts lists from Outlook ... The following sample CSV file adds a contact for John Doe to the Sales ... I suggest you also post in the Exchange Server newsgroup. ...
    (microsoft.public.windows.server.sbs)