Thread: [Solved] Sorting Challenge
View Single Post
 
Old 06-21-2012, 08:26 AM
gbaker gbaker is offline Windows 7 32bit Office 2010 32bit
Competent Performer
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Sorting Challenge

I have a challenge Sorting a list. Instead of the information moving to the top it falls to the bottom. All the blanks are on the top.
I have attached a worksheet showing the issue I am facing.
Can anyone help!!!
Thanks in advance.





Code:
Sub testforforum()
'
' testforforum Macro
'
'
    ActiveWindow.SmallScroll Down:=102
    Range("A1:L").Select
    ActiveWorkbook.Worksheets("DATA").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("DATA").Sort.SortFields.Add Key:=Range( _
        "A1:A15"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
        :=xlSortNormal
    ActiveWorkbook.Worksheets("DATA").Sort.SortFields.Add Key:=Range( _
        "B1:B15"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
        :=xlSortNormal
    With ActiveWorkbook.Worksheets("DATA").Sort
        .SetRange Range("A1:A15")
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub
Attached Files
File Type: xlsx test for forum.xlsx (9.8 KB, 14 views)
Reply With Quote