+ Reply to Thread
Results 1 to 3 of 3

Sorting Listbox

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Sorting Listbox

    Hi,

    I have a listbox that's populated from a range using rowsource. It also is set-up to display column headers. What I'd like to do is make it when a user clicks on the column header, it sorts based on which column was clicked. Is this possible?

    Currently, I've created buttons for each column heading, so the user can click the corresponding button to make the listbox sort by that data, but almost every program out there allows a user to click on the header to do this, so I'm wondering if it's even possible.

    Thanks!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Sorting Listbox

    I like to use the double click event for this kind of sort. Put this in the sheet's code module, double click on a cell and the data will be sorted on that column.
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: Sorting Listbox

    is this for excel 2007?for headers of listbox or the sheet?
    i tried the code but nothing happened when i click on my headers(for listbox) :S
    btw i am using listbox from activex, 01-fmmultiselectmulti
    Last edited by shg; 08-11-2010 at 12:14 AM.

+ 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