Multi criteria sorting

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,075
Office Version
  1. 2019
Platform
  1. Windows
Is it possible to sort a table by Date & Item. In AV11:AZ500, when i enter an expense, it sorts by date, but also I would like to sort by Item.

Example:

1/2/10 Clothes
5/2/10 Clothes

3/20/10 Dry Cleaning
4/23/10 Dry Cleaning
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Do you get what you want when you sort by Item as the first sort field, and Date as your second sort field?
 
Upvote 0
I know how to sort by item. This sorts by date...

Code:
Range("AV11:AZ500").Sort Key1:=Range("AV11"), Order1:=xlAscending, Header:=xlNo

But how do I get it to sort by item also?
 
Upvote 0
Is this correct?

Code:
Range("AV11:AZ500").Sort Key1:=Range("AV11"), Order1:=xlAscending, Header:=xlNo, Key2:=Range("AY11"), Order2:=xlAscending, Header:=xlNo

or

Code:
Range("AV11:AZ500").Sort Key1:=Range("AV11"), Key2:=Range("AY11"),Order1:=xlAscending, Header:=xlNo
 
Upvote 0
Your first guess looks closer, although maybe you shouldn't have Header in there twice.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,328
Members
452,907
Latest member
Roland Deschain

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