LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Sort method of range

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need really fast method to sort data for my part numbering spread Chris Dundorf Excel Discussion (Misc queries) 7 March 24th 10 06:05 PM
Set range with Find method jlclyde Excel Discussion (Misc queries) 1 December 3rd 08 05:44 PM
Autofill method of range class failed Appache Excel Discussion (Misc queries) 5 February 27th 08 03:37 PM
VBA Sort method w/more than 3 Keys KenRoy Excel Discussion (Misc queries) 1 August 26th 05 10:48 PM
ClearContents method on a passed range bryan New Users to Excel 2 January 19th 05 08:49 AM


All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"