Macro to sort ranges in column

mikey1987

Board Regular
Joined
Mar 22, 2013
Messages
65
Hello all, I'm looking for a macro to sort ranges based on a recurring word in column W. In column W I have a word ("Wave 4") and every time I see that word, I want to sort the range based on the values in column W from big to small. And then it has to look for the next Wave 4 word and do it all over again. Allow me to visualise below. You see that"Wave 4" is in cell W6, W19 and W 32. So I want to sort range T6 to W13 based on the values in column W (already done here). Then I want the macro to look at the next "Wave 4" and do the same again. Is this possible?
1503962_589577097757313_1145816401_n.jpg
This would be a tremendous help, thanks in advance.
 
Hello,

This gives the following error: Run-time error '1004':
The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By Box isn't the same or blank.
Does it have something to do with the fact that S1 is blank?

Regards
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try your Data in this Example:-
The problem could be that data in column "S" does not relate to a range of data in columns "T to W".
If that does not work , Perhaps you could post and example file or show more datails.
https://app.box.com/s/ajkcfblu4fhx5moiva5f

You can post data using "app.box.com"
Regrds Mick
 
Upvote 0
I'm sorry ,but I am not able to download your file from that link. The download page does not show from that link.!!!!
 
Upvote 0
I think I found it :)
I changed

Dn.Offset(, -3).Resize(, 4) to Dn.Offset(, -4).Resize(, 5) and now it works :D
No idea what I did, but it does the trick :P

Thanks so much MickG
</pre>
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,840
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top