Sorting issue has got me puzzled!

A

anon

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!
 
J

Joel

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??????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top