+ Reply to Thread
Results 1 to 2 of 2

active column headers for sorting

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    Antarctica
    Posts
    7

    active column headers for sorting

    hello all,

    i'm new to excel programming, so i'm not sure if there is just a simple macro that'll do this or if i need vba, so bear with me.

    i have a table of values, with headers along the top and what i'd like to be able to do is to sort the entire table (all rows) according to which column header i click on, just like sorting by date, filename etc. in Explorer (on Windows) or in the Finder (on OS X).

    this seems like pretty standard fare, but my searches both in the forum and on google have not revealed anything.

    any help would be greatly appreciated!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This is the basic code that you can adapt. It uses the double click event, so double clicking on a header cell will sort the table.


    Please Login or Register  to view this content.
    To add the code right click on the sheet's tab and choose View Code. This will open the VB Editor. In the left hand drop down select WorkSheet and in the right hand one find BeforeDoubleClick. Then copy & paste the code.

    You will need to amend the row & column references.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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