+ Reply to Thread
Results 1 to 4 of 4

Sorting Data by clicking the header

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    New York, Syracuse
    MS-Off Ver
    Excel 2007
    Posts
    2

    Sorting Data by clicking the header

    I'm currently developing a spread sheet in Excel 2007 of general plant information for my office. We have some not so computer friendly people in the office so we wish to make this as simple as possible. The ideal situation would be to set it up so that you could just click on any header such as; Scientific Name, Common Name, Native location etc. and all of the data would be sorted by that header in alphabetical order.

    I have it set up so that you go to Data -> Sort A-Z button, but they want it simpler.

    I have also formatted it so that there are the pull down windows on each column that you click and then select how you would like to order the information.

    They want it simpler.

    I have been researching this and think that Macros are the answer. However, whenever I try to run one this message pops up:Macro Error.jpg

    I have selected Enable All Macros and checked 'Trust access to the VBA project object model'. That is as far as the internet has been able to take me so far.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sorting Data by clicking the header

    jkurtz,

    Welcome to the forum!
    Attached is an example workbook based on the criteria you described.
    It uses the worksheet double-click event to sort the data by that double-clicked column header ascending.

    In the Sheet1 code module:
    Please Login or Register  to view this content.

    Also, from a security standpoint, you should never trust access to the VBA project object model.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-10-2012
    Location
    New York, Syracuse
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Sorting Data by clicking the header

    tigeravatar,

    Thank you for the welcome to the forum!

    And thank you so much for the help! That is exactly what I'm looking for to a T! You are amazing!

    jkurtz

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sorting Data by clicking the header

    You're very welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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