+ Reply to Thread
Results 1 to 3 of 3

Automatically Sort Tables with Headers

  1. #1
    Registered User
    Join Date
    04-10-2020
    Location
    New York
    MS-Off Ver
    2016
    Posts
    2

    Unhappy Automatically Sort Tables with Headers

    Hi


    I'm trying to automatically sort the 2 tables on a spreadsheet using the macro below, however when the macro runs, it sorts the headers to the bottom even though I wrote xlYes for header. I think this may have something to do with the fact that there is data above the headers because it works when there is nothing on top of the headers.

    The tables are located from C2:D5 and C12:D15 with numbers in cells C1,D1,C11, and D11 above the headers counting the number of cells.

    Any suggestions on how to fix? Thanks! I've attached a screenshot of the worksheet as well.
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by AliGW; 04-10-2020 at 09:36 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,812

    Re: Automatically Sort Tables with Headers

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will provide the link for you this time.)

    https://www.mrexcel.com/board/thread...s-vba.1130303/

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I will do it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-10-2020
    Location
    New York
    MS-Off Ver
    2016
    Posts
    2

    Re: Automatically Sort Tables with Headers

    Thank you for letting me know....I'm sorry for not included link and tag. I'm new to the site and am getting to know things.

    Will be sure not to make these mistakes next time!

+ 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. autofilter method of range class failed -header has tables headers and non table headers
    By naveen.acheanz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2016, 08:21 AM
  2. [SOLVED] how to sort a sort data based on headers
    By luis6777 in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 08-27-2015, 02:24 PM
  3. Update automatically tables with related headers that are in different sheets
    By cgkmal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2013, 08:39 PM
  4. Replies: 3
    Last Post: 09-30-2010, 12:30 PM
  5. Replies: 3
    Last Post: 05-08-2010, 08:47 AM
  6. Replies: 1
    Last Post: 03-09-2006, 01:24 PM
  7. [SOLVED] Automatically Sort Tables
    By tamato43 in forum Excel General
    Replies: 2
    Last Post: 03-22-2005, 04:06 PM

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