+ Reply to Thread
Results 1 to 2 of 2

How to sort a drop-down list?

Hybrid View

  1. #1
    Daniel
    Guest

    How to sort a drop-down list?

    I have a worksheet (wsA) acting as a database with columns ID, Name and Amount.

    I defined a name for each of these of columns.

    On the other worksheet (wsB), I made a drop-down list for each of these
    names using Data->Validation.

    However, the items in the drop-down list is not sorted because my data in
    wsA is not sorted and I don't want to sort it manually everytime I add a
    record to wsA. I want it to be sorted because this is easier for user to
    search for a particular record.

    Is there a way to sort the items in the drop-down lists without using Macro?
    If no, marco is fine too.

    Thanks.

  2. #2
    David McRitchie
    Guest

    Re: How to sort a drop-down list?

    Hi Daniel,
    You would need a macro, but you could use a low maintenance macro
    that sorts the list upon deactivation of the worksheet that the defined name
    actually refers to. I would not suggest sorting upon change as the flipping
    around of cells would confuse you.
    http://www.mvps.org/dmcritchie/excel/event.htm

    No specific macro for Private Sub Worksheet_Deactivate()
    but you can use the example in
    http://www.mvps.org/dmcritchie/excel...g.htm#activate
    to give you an idea, or perhaps it as is..

    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "Daniel" <Daniel@discussions.microsoft.com> wrote in message news:1CB71DA6-9171-4FB4-8023-1A649B9EDF96@microsoft.com...
    > I have a worksheet (wsA) acting as a database with columns ID, Name and Amount.
    >
    > I defined a name for each of these of columns.
    >
    > On the other worksheet (wsB), I made a drop-down list for each of these
    > names using Data->Validation.
    >
    > However, the items in the drop-down list is not sorted because my data in
    > wsA is not sorted and I don't want to sort it manually everytime I add a
    > record to wsA. I want it to be sorted because this is easier for user to
    > search for a particular record.
    >
    > Is there a way to sort the items in the drop-down lists without using Macro?
    > If no, marco is fine too.
    >
    > Thanks.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1