Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box Sort - Function or ActiveX option? (2002)

    Hi everyone, I know combo box sorting has been discussed before. However, I was wondering if anyone knew of: 1) A freeware ActiveX (ocx) combo box alternative COMPATIBLE with VBA that has a .Sort property similar to Visual Basics', or 2) A generic function/ sub for sorting the combo boxes. It still amazes me, that after all these years, it is so difficult and tedious to sort combo boxes using VBA, I just don't understand it... I tried a few combo box code snippets that I thought would work but I guess they were more for VB (including a few freeware alternatives, but under VBA they got completely confused ). Well, thanks for your help and any pointers, I really appreciate it!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box Sort - Function or ActiveX option? (2002)

    A Google search turned up several custom combo box components with sorting capability, but none of them were free.

    It wouldn't be very hard to write code to sort a combo box, but there are several types of combo box available in Office applications:
    - The drop-down form field from the Forms toolbar in Word.
    - The combo box from the Forms toolbar in Excel.
    - The combo box from the Control Toolbox in Excel, Word and PowerPoint.
    - The combo box from the Toolbox belonging to UserForms (in the VBA Editor)
    Which one do you want to use?

  3. #3
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Sort - Function or ActiveX option? (2002)

    Thank you Hans. This is the one I want: "The combo box from the Toolbox belonging to UserForms (in the VBA Editor)"

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box Sort - Function or ActiveX option? (2002)

    I have attached sample code that can be used to sort a list box or combo box with one column, containing text items. Put the code in a standard module, and call it like this

    SortList Me.ComboBox1

    The code would have to be expanded to handle multi-column list boxes and combo boxes.

Posting Permissions

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