Correct, row 2 is my header. Your code works just like I want on my test file, however, when I run it on my larger worksheet (over 4700 lines), the header is sorted into my data, and the sort on column H doesn't appear to work.
Correct, row 2 is my header. Your code works just like I want on my test file, however, when I run it on my larger worksheet (over 4700 lines), the header is sorted into my data, and the sort on column H doesn't appear to work.
This is a more accurate example of what I'm working with, but on a much larger scale. When I run your macro on this, the header gets sorted along with the data.
Sub SortIt() Dim wks As Worksheet Set wks = ActiveSheet With wks .UsedRange.Offset(1).Sort _ Key1:=.Range("J2"), Order1:=xlAscending, _ Key1:=.Range("H2"), Order2:=xlAscending, _ Header:=xlYes, _ MatchCase:=False, _ Orientation:=xlTopToBottom End With End Sub
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks