+ Reply to Thread
Results 1 to 10 of 10

Sort data in a userform combobox

  1. #1
    Registered User
    Join Date
    08-04-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    35

    Sort data in a userform combobox

    Hi all,

    I am currently frustrated over how to sort a list in a userform dropdown box. I have only 2 sheets which are SALES and STATEMENT. The statement sheet contains userform to populate the the results of my report. My problem is that the dropdown for the customer list does not show in alphabetical order. This is not an issue when there are only a few sales but gets very frustrating with large numbers of sales.

    I have attached a sample copy of my spreadsheet in the hope that someone smarter than me can help.
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Sort data in a userform combobox

    I am not sure if this will work in your version of Excel.

    Try changing your Userforn UInitialisation Event to:

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 11-02-2020 at 01:32 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Sort data in a userform combobox

    Hi Honeythunder,

    I remember helping you on this file in the past ... You can change the UserForm_Initialize with the below
    Please Login or Register  to view this content.
    Edit : Sorry @mehmetcik, I was working on the file as well & didn't see your post until I posted mine & the page was refreshed
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  4. #4
    Registered User
    Join Date
    08-04-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    35

    Re: Sort data in a userform combobox

    Thank you Mehmetcik for your quick reply. Unfortunately it did not work for me. I am using excel 2019.

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Sort data in a userform combobox

    Courtesy of Tom Urtis.
    Please Login or Register  to view this content.
    torachan

  6. #6
    Registered User
    Join Date
    08-04-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    35

    Re: Sort data in a userform combobox

    Thank you nankw83, I now get a runtime error and the form does not initialise.

  7. #7
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Sort data in a userform combobox

    I am not getting any error Try the attached file
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-04-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    35

    Re: Sort data in a userform combobox

    Again, thank you so much nankw83, I have incorporated your solution into my file and all is ok. Your help is greatly appreciated.

  9. #9
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Sort data in a userform combobox

    Glad to help & you're welcome

    If that takes care of your question, please take a moment to mark this thread as [SOLVED] from the Thread Tools above your first post & consider * Add Reputation to those who have helped by clicking the star icon under their usernames

  10. #10
    Registered User
    Join Date
    08-04-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    35

    Re: Sort data in a userform combobox

    Many thanks to torachan. Your solution also worked perfectly. I am grateful for all the help given to me on this forum.

+ 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. UserForm (use choice from combobox to fill in corresponding data in other combobox)
    By sergi117 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2018, 11:23 PM
  2. How to sort A to Z data of combobox Userform
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2017, 06:47 PM
  3. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  4. [SOLVED] Populate data from a Combobox in a UserForm into a combobox in another UserForm
    By johnw993 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2015, 04:32 AM
  5. Userform - selecting data for combobox 2 basedon slection in combobox 1
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 04:27 PM
  6. [SOLVED] send data from userform combobox to userform combobox
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-18-2013, 04:47 PM
  7. [SOLVED] Populate and sort combobox on userform using VBA
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-07-2013, 09:22 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