Results 1 to 8 of 8

Sorting within Boxes (revisited)

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,962

    Sorting within Boxes (revisited)

    I need to revisit a closed thread (http://www.excelforum.com/excel-prog...hin-boxes.html).

    RomperStomper gave me a great macro that I thought did what I needed, but it doesn't quite do it. See the attached file. On lines 148 and 149 of each tab you can see the issue. In the Unsorted, the correct folks report to the correct PACs. In the Sorted, different folks are reporting to the PACs.

    Here's the macro Romper gave, which would be applied to the "Unsorted" tab to sort it correctly. I don't understand the macro well enough to try my hand at altering it, so hope someone older and wiser (or at least wiser) would take a look. Thanks in advance.
    Sub Resort()
       Dim lngStartRow As Long, lngEndRow As Long, lngLastRow As Long
       Dim lngColCount As Long
       Dim rngSort
       
       lngLastRow = Cells(Rows.Count, 1).End(xlUp).Row
       lngColCount = Cells(1, Columns.Count).End(xlToLeft).Column
       
       lngStartRow = 2
       Do
          lngEndRow = Cells(lngStartRow, 1).End(xlDown).Row - 1
          Range(Cells(lngStartRow, "C"), Cells(lngEndRow, lngColCount)).Sort key1:=Cells(lngStartRow, "K"), _
                      order1:=xlAscending, key2:=Cells(lngStartRow, "I"), order2:=xlAscending, header:=xlNo
          lngStartRow = lngEndRow + 2
       Loop While lngEndRow < lngLastRow
    End Sub
    Attached Files Attached Files
    Last edited by Mordred; 08-30-2011 at 01:11 PM.

Thread Information

Users Browsing this Thread

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

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