Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Sorting issue has got me puzzled!

Hi all,

I've tried numerous combinations of selection.sort in my code however
none are working. I'm stumped however believe maybe have spotted a
possible cause. My code is showing the word SORT in capitals (non
defaulting to normal text as expected). I thought this may be because
somewhere in my personal wb or the current open wb I had stupidly
named a sub SORT however cannot find anything.


Please see the code I have tried below, any help would be much
appreciated;


ActiveSheet.Range("A2:ad" & ro + 1).SORT Key1:=Range("c2")


or


ActiveSheet.Range("A1:ad" & ro + 1).Select
Selection.SORT Key1:=Range("C1"), Order1:=xlDescending,
Header:=xlYes,
OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom


The code does not error, just does not sort the selected range. I have
looked at sort code in another workbook and that is NOT in capitals. I
have checked and there are no macros/modules containing any code in my
personal wb, (and I have no other wb's open) also the word SORT does
not appear anywhere else in my code (eg. I have not been silly enought
to Dim SORT).

I'd appreciate it if anyone can spot my (no doubt stupid) error!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Sorting issue has got me puzzled!

When I copy both your statements to VBA the sort goes to nomal
capitalization. Try doing it yourself. Make sure your haven't redefine sort
to something else. check you DIM statements and paremters passed into the
function.

DIM SORT as Integer??????

"anon" wrote:

Hi all,

I've tried numerous combinations of selection.sort in my code however
none are working. I'm stumped however believe maybe have spotted a
possible cause. My code is showing the word SORT in capitals (non
defaulting to normal text as expected). I thought this may be because
somewhere in my personal wb or the current open wb I had stupidly
named a sub SORT however cannot find anything.


Please see the code I have tried below, any help would be much
appreciated;


ActiveSheet.Range("A2:ad" & ro + 1).SORT Key1:=Range("c2")


or


ActiveSheet.Range("A1:ad" & ro + 1).Select
Selection.SORT Key1:=Range("C1"), Order1:=xlDescending,
Header:=xlYes,
OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom


The code does not error, just does not sort the selected range. I have
looked at sort code in another workbook and that is NOT in capitals. I
have checked and there are no macros/modules containing any code in my
personal wb, (and I have no other wb's open) also the word SORT does
not appear anywhere else in my code (eg. I have not been silly enought
to Dim SORT).

I'd appreciate it if anyone can spot my (no doubt stupid) error!

Reply
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
Sorting issue has got me puzzled! anon Excel Programming 0 July 20th 08 01:32 PM
Sorting issue Sige Excel Programming 13 February 10th 06 03:19 PM
puzzled chapm4 Excel Worksheet Functions 1 August 24th 05 08:41 PM
&quot... whats this??? am puzzled aken Excel Programming 4 June 20th 05 02:05 PM
EASY ONE ! using countIF.. puzzled justin_vasko Excel Discussion (Misc queries) 4 May 25th 05 05:13 PM


All times are GMT +1. The time now is 09:22 PM.

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

About Us

"It's about Microsoft Excel"