In the attached workbook, I have a list (Columns A-E) that I want sorted so that I get the results that are shown in Columns I-M.
However, when I run the code below, I can't seem to get that result. Could someone please tell me what I am missing?
Sub SortLaddersV02Pre2012() Application.DisplayAlerts = False On Error Resume Next Columns("A:E").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Columns("A:E").Select With ActiveWorkbook.Worksheets("Sheet1").Sort .SortFields.Add Key:=Range("D1"), Order:=xlAscending .SortFields.Add Key:=Range("A1"), Order:=xlAscending .SetRange Range("A1:E968") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With ActiveWorkbook.Save 'ActiveWorkbook.Close Application.DisplayAlerts = True End Sub
Bookmarks