Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Sort A-Z a variable range of cells | Excel Discussion (Misc queries) | |||
VBA Variable Range Sort | Excel Discussion (Misc queries) | |||
How do I use a variable in a sort macro | Excel Worksheet Functions | |||
Macro - Data Sort -Variable Selection | Excel Discussion (Misc queries) | |||
1-variable Data Table dependent on MS Query fails to update correctly | Excel Discussion (Misc queries) |