+ Reply to Thread
Results 1 to 5 of 5

Alphabetizing combo boxes

  1. #1
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267

    Alphabetizing combo boxes

    I have a list of items down column A and I have a combo box that shows on a UserForm that has all of those items in it, so the user can pick one, then get more info on it. Is there a line of code that takes all the items in the combo box and puts them in alphabetical order? That would make it a lot more user friendly and easy to use.

    Thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello wmorrison49,

    If your combo box list is loaded from the worksheet, or you are using the ListFill property then the easiest thing to do is sort the range first.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    I want to keep those cells in the order they are, though. I only want the combo box to be sorted alphabetically. If I have to, I can just write a macro to copy and paste the list somewhere else, alphabetize that, and do the combo box from that, but I would rather just keep it simple.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello wmorrison49,

    The method you suggested is the easiest solution to implement. The other alternative requires reading the Combo Box list into an array, and then running a sorting algorithm on the array then loading it back again into the Combo Box. It is faster and easier to use what the system has to offer rather than reinvent the wheel. If you really are curious how to do it this way, I can write a code routine for you.

    Sincerely,
    Leith Ross

  5. #5
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    Thanks anyways, but don't worry about it. I will do it the way I was originally thinking of. Thanks for your help.

+ 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