+ Reply to Thread
Results 1 to 4 of 4

Sorting - how to select part of worksheer

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    13

    Question Sorting - how to select part of worksheer

    I am trying to create a VBA Macro that sorts the data on a worksheet.

    I have 10 rows of header junk that I want left as is, then 300 to 500 rows of
    data I want sorted - on data of a particular column.

    Right now its 340 ... and this works (sorting on col M)


    Please Login or Register  to view this content.
    What if I go past 1000 rows ? So, I wanted a way to make it work for any number of
    rows. I tried this,



    Please Login or Register  to view this content.
    but my header data in row 10 ended up getting pushed to the very last row. It apparently
    was included in the sort.

    How can I get this done correctly ?
    Last edited by vlady; 11-05-2012 at 01:26 AM. Reason: code tags

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,711

    Re: Sorting - how to select part of worksheer

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Sorting - how to select part of worksheer

    That worked fine - thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,711

    Re: Sorting - how to select part of worksheer

    You're welcome.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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