Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-15-2017, 09:59 AM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 72
ewso is on a distinguished road
Default custom sort macro

I need a macro that will let me reuse the last custom sort that I did. So if the last custom sort that I did sorted by column, sorted on values, and then sorted order using a custom list, I want a macro that lets me use the exact same custom sort on the next selection of cells that I choose without having to go through the whole custom sort again. Is there a macro that can do this?



thanks

Last edited by ewso; 09-16-2017 at 12:29 AM.
Reply With Quote
  #2  
Old 09-15-2017, 11:18 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Windows 7 64bit Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 1,901
Pecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nice
Default

Perhaps post a small sample sheet showing some data and expected results?
Reply With Quote
  #3  
Old 09-15-2017, 11:44 PM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 72
ewso is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
Perhaps post a small sample sheet showing some data and expected results?
Hi,

Is there a way for excel to remember what custom sort I used last and to reuse it again without having to go through the custom sort wizard every time? I do a lot of sorts where I click on the custom sort button, sort by name, values, and then I use a custom list of names. The custom list changes quite a bit though, so I would need to be able to just have excel remember what custom sort rules I used the last time and quickly let me use them again.
Reply With Quote
  #4  
Old 09-16-2017, 02:41 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Windows 7 64bit Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 1,901
Pecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nice
Default

Please post a sample as requested and expected results
Reply With Quote
  #5  
Old 09-16-2017, 03:44 AM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 72
ewso is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
Please post a sample as requested and expected results
I don't know what I would put in a sample. I basically just want to reuse the last custom sort I used on whatever data I choose without having to manually put in all the sort criteria every time. The sort usually looks like this...

Sort by: Column A, Sort on: Values, Order: Custom List

..The custom list changes all the time though. That's why I hope excel can remember the last custom sort I used so I can just click a button and have it sort any data I select using the same criteria and list of the last custom sort I used.
Reply With Quote
  #6  
Old 09-16-2017, 09:35 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Windows 7 64bit Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 1,901
Pecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nice
Default

Record a macro while applying your custom sort.
You can then reuse it after adapting the code to variable ranges
Reply With Quote
  #7  
Old 09-16-2017, 10:36 PM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 72
ewso is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
Record a macro while applying your custom sort.
You can then reuse it after adapting the code to variable ranges
What do I do after I record the custom sort? I no longer need the list I used when recording the sort.
Reply With Quote
  #8  
Old 10-10-2017, 12:08 PM
ewso ewso is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2016
Posts: 72
ewso is on a distinguished road
Default

Is there any way that this can be done?

thanks
Reply With Quote
Reply
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to sort columns SerenityNetworks Excel Programming 4 09-02-2016 06:20 AM
VBA Sort Custom Order tandchas Excel Programming 1 04-15-2016 05:38 PM
Custom sort - two header_lines? Officer_Bierschnitt Excel 1 11-19-2015 07:48 AM
Remove the * from the SubCate, Custom Sort, Replace..Help Please - I need. Thanks shilabrow Excel Programming 2 07-10-2014 11:09 AM
Generic range for custom sort macro? tswiers Excel Programming 2 08-11-2011 02:40 AM


All times are GMT -7. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft