VBA Code to Sort Based on Multiple Special Criteria (List)

OilEconomist

Active Member
Joined
Dec 26, 2016
Messages
380
Office Version
  1. 2019
Platform
  1. Windows
Thanks in advance for your assistance.

How would I created a VBA code to do a special sort based on the following criteria.

(1) First sort by the values set forth in columns D and E in the given order. Basically the data set with N rows (Range("A3:T" & LastRow)) I want to sort in the following order (two criteria). So first it will gather all data that have red as an entry in column D and circles in column E.
1639212585095.png


Once it sorts based on that, I would then like it to sort within each of those based on
(2) Column D in alphabetic order
(3) Column A based on date.

At the end of the day, I first want it to sort on circles and red (combination) and then within circles and red, sort based on column D and then column A. Then do the same thing with each entry in column E and D.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,159
Messages
5,852,434
Members
431,507
Latest member
gatobarbieri

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
Top