Try the following instead.
Note that at the beginning I create a reference to to the worksheet in ThisWorkbook. The object 'ThisWorkbook' always represents the workbook that the macro is stored in.
I have also done away with a lot of the select statements as they are unneccasary. You do not need to select a range, and then refer to the selection, you can just refer directly to the range.
For example;
becomes:
Here is the code:
Incidently I have highlighted the sort lines as I am unsure what you are trying to achieve there?
At the moment it sorts into Ascending order by B4, then it takes that data and resorts it again but this time into Ascending order by D4, as in two SEPERATE sorts where the second one will destroy the results of the first one.
Were you actually wanting to sort by B4, and then have those sorted results sorted by D4 as a secondary sort?
Bookmarks