I have some sheets which I would like to loop through and use sort descending on column S, would somebody help me out with the code to do so? I actually have the looping code already, I just need the sort descending bit.
I have some sheets which I would like to loop through and use sort descending on column S, would somebody help me out with the code to do so? I actually have the looping code already, I just need the sort descending bit.
Last edited by eonizuka; 01-05-2010 at 02:46 PM.
Try recording a macro?
Entia non sunt multiplicanda sine necessitate
I used the macro recorder and inserted the recorded code into the macro I'm using. I'm getting an error on the .sort section of the code stating "method or data member" not found. I'm not sure of the syntax to point to the current worksheet either. Thanks for your patience with me on this. Edit: I removed the (s) from the worksheet object and the code runs but it isn't sorting the data.
![]()
Please Login or Register to view this content.
Last edited by eonizuka; 01-05-2010 at 01:15 PM.
Untested (I edited this in 2003). Your references were not qualified to the worksheet. The most important line in the code is the very first one.
![]()
Please Login or Register to view this content.
The code isn't sorting the data; I have attached a sample workbook with the data and code. I slightly modified it for use with just this one sheet.
Konnichi wa Eonizuka san,
Akemashite omedetō gozaimasu!
I can't edit Excel 2007 files, only read them. So, the modifications to your macro are untested, but it should work. Here is the modified macro.
![]()
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks