+ Reply to Thread
Results 1 to 9 of 9

Macro to sort sheet based on header text in Row 1

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    8

    Macro to sort sheet based on header text in Row 1

    Hello
    Can anyone help me with a macro to sort a sheet based on the text in the header, ie "Service".


    Many thanks in advance for your help

    Nyree
    Last edited by nyree; 04-01-2015 at 08:22 AM.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Macro to sort column based on header text in Row 1

    As far as I know, you can't sort a column based on a value.
    Do you mean you want to sort a sheet based on a column when the header is a certain value or word?
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    02-21-2013
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro to sort column based on header text in Row 1

    Hello JaspeD
    Yes, my sheet has several columns and I want to always sort the column called "service", regardless of where it is in the sheet

    Thanks
    Nyree

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to sort column based on header text in Row 1

    Just the column? Or the entire sheet based on the column?

  5. #5
    Registered User
    Join Date
    02-21-2013
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro to sort column based on header text in Row 1

    Hello John
    The entire sheet

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to sort sheet based on header text in Row 1

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Macro to sort sheet based on header text in Row 1

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-21-2013
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro to sort sheet based on header text in Row 1

    Hello John
    That works perfectly!
    THANK YOU

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to sort sheet based on header text in Row 1

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rules and mark this thread as SOLVED. Review the link for guidance.

    http://www.excelforum.com/forum-rule...rum-rules.html

+ 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. [SOLVED] Rearrange(sort) Columns based on number in Column header string.
    By hifliers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 01:36 AM
  2. [SOLVED] I have a sort macro. How to add script to preselect rows to sort based on column value?
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-09-2014, 02:25 AM
  3. Replies: 1
    Last Post: 01-30-2014, 01:42 PM
  4. [SOLVED] Sort multiple columns based on column header
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 01-09-2013, 09:55 AM
  5. Delete column range based on header text
    By sunsoar77 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2012, 07:45 PM

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