K
Kiwipingu
Hi,
Can you please help me identify why this macro is failing with the
following error?
Runtime error 1004: Sort method of Range class failed
Row 7 is the header row
Data range has a variable number of rows (so using end(xldown) to
select the range)
Using column BA to select a contiguous range of cells as all cells are
populated in the column
Then using that selection to select entire rows in my list
Sorting as per criteria using row 7 as header row
Rows("7:7").Select
Range("BA7").Activate
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.EntireRow.Select
Selection.Sort Key1:=Range("BE8"), Order1:=xlAscending,
Key2:=Range("BB8" _
), Order2:=xlDescending, Key3:=Range("BM8"),
Order3:=xlDescending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=
_
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("BN8:BN9").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("BN9").Select
Thanks,
AS
Can you please help me identify why this macro is failing with the
following error?
Runtime error 1004: Sort method of Range class failed
Row 7 is the header row
Data range has a variable number of rows (so using end(xldown) to
select the range)
Using column BA to select a contiguous range of cells as all cells are
populated in the column
Then using that selection to select entire rows in my list
Sorting as per criteria using row 7 as header row
Rows("7:7").Select
Range("BA7").Activate
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.EntireRow.Select
Selection.Sort Key1:=Range("BE8"), Order1:=xlAscending,
Key2:=Range("BB8" _
), Order2:=xlDescending, Key3:=Range("BM8"),
Order3:=xlDescending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=
_
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("BN8:BN9").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("BN9").Select
Thanks,
AS