+ Reply to Thread
Results 1 to 6 of 6

sort alphabetically values added to combobox

  1. #1
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    sort alphabetically values added to combobox

    hi,

    im using the code below to add values to a combobox, the values are string
    once all the values are added to the combobox
    is it possible to sort the values in the combobox alphabetically?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: sort alphabetically values added to combobox

    Load your results in a System.Collections.ArrayList which has a Sort command.
    Then use this list to fill Combobox.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: sort alphabetically values added to combobox

    Please Login or Register  to view this content.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: sort alphabetically values added to combobox

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: sort alphabetically values added to combobox

    thanks guys!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: sort alphabetically values added to combobox

    You are welcome and thanks for the rep.

    Just for your information, ArrayList can't sort data like "A123, E1", "A1123, D1", "A2, C1" etc.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sort Combobox list alphabetically
    By plans in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2015, 01:51 PM
  2. [SOLVED] Sort Mulple Values alphabetically within a Cell seperated by a comma
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-27-2015, 02:46 AM
  3. Sort ComboBox alphabetically
    By Onweerwolf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-12-2014, 10:45 PM
  4. How to alphabetically sort values in a dynamic range?
    By max3732 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2014, 07:54 AM
  5. Sort combobox items alphabetically
    By aprilapple04 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-16-2013, 03:12 AM
  6. [SOLVED] Sort all sheets alphabetically, values separated by underscore
    By sans in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2012, 03:09 PM
  7. Sort combobox items alphabetically
    By VishalGupta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2011, 01:13 AM

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