Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I am performing a sort programatically in Excel 2002 on Windows XP The line of code to sort is as follows: Range(Cells(15, 1), Cells(endrow, Range("iNonQualStatus").Column)).Sort Key1:=Range("iItemType"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=ordercustomnumber, MatchCase:=False, Orientation:=xlTopToBottom This throws the following error: Sort Method of Range class failed The sheet is protected both programatically and using Excel's protect option from the menus. No matter what I try regarding setting different protections at run-time or saving the sheet with different protections, whenever I hit the line of code above, the allowsorting propery is false. In order to test sorting I created a new workbook and sheet to test the sorting functionality and even this fails - with no protections, and allowsorting reporting true when interrogated at runtime (although this time the error is 1004 Application-defined or object-defined error). Can anyone suggest why this doesn't work in either scenario? Many thanks -- Rich (change nospam to mlu035 to reply direct) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need really fast method to sort data for my part numbering spread | Excel Discussion (Misc queries) | |||
Set range with Find method | Excel Discussion (Misc queries) | |||
Autofill method of range class failed | Excel Discussion (Misc queries) | |||
VBA Sort method w/more than 3 Keys | Excel Discussion (Misc queries) | |||
ClearContents method on a passed range | New Users to Excel |