Results 1 to 4 of 4

Sorting - how to select part of worksheer

Threaded View

  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)


    Worksheets("Out").Range("A11:M999").Sort _
            Key1:=Worksheets("Out").Range("M11"), _
           order1:=xlAscending
    What if I go past 1000 rows ? So, I wanted a way to make it work for any number of
    rows. I tried this,



    Worksheets("Out").Range("A11").End(xlDown).Sort _
            Key1:=Worksheets("Out").Range("M11"), _
            order1:=xlAscending
    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

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