I have a workbook I originally started when using excel 2003 but am now using excel 2016. When I need a sort in a macro I use the 'record macro' option. In the 2016 sort the worksheet name is part of the sort, but the 2003 sort does not have the worksheet name. The 2016 sort causes an issue for me because I use the sort routine for 11 different worksheets, so will need to use IF commands to determine which worksheet I am sorting and put the appropriate worksheet name in the routine. This will work but I'd rather not have to duplicate the sort in 11 different IF's.
Is there a way to change the code to just sort the current (active) worksheet? I've included a example sort from 2003 excel and one from 2016 excel.
Here's a typical sort I have done using 2003:
Here's one I did using 2016:
As you can see the worksheet name (E2_TB_P2) is used in several places in the 2016 sort.
Bookmarks