(probably) a simple sorting question

DrPips

New Member
Joined
Aug 14, 2009
Messages
35
Hi all,

I think this is probably quite simple, but google searches are bringing up something slightly different to what I want.

I have an accounts sheet, columns A-C are income, E-G are outgoings. I want to sort income by date, which is column A, and the outgoing by date, which is column E. When I try and filter this in excel, it gives me an error message saying "The command you chose cannot be performed on multiple selections.

Is there an easy way to do this?

Thanks,
Dom
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
4,301
.
Here are two small macros :'

Code:
Option Explicit


Sub srt()
Sheet2.Range("A1").CurrentRegion.Sort key1:=Range("A1:C20"), Header:=xlYes
End Sub


Sub srt2()
Sheet2.Range("E1").CurrentRegion.Sort key1:=Range("E1:G20"), Header:=xlYes
End Sub
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
Probably only use sort and do once for each three columns of data.
example:
Code:
Dim lastRow As Long
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:C" & lastRow).Sort Range("A1"), xlAscending, Header:=xlYes
Range("E1:G" & lastRow).Sort Range("E1"), xlAscending, Header:=xlYes
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,083
...
I want to sort income by date, which is column A, and the outgoing by date, which is column E. When I try and filter this in excel, it gives me an error message saying "The command you chose cannot be performed on multiple selections.
...
Filtering and sorting are different. If you want one, don't do the other.

If you are sorting, you need to sort an entire continuous region. All columns and all rows in that region will be effected by the sort.
 
Last edited:

Forum statistics

Threads
1,148,324
Messages
5,746,121
Members
423,993
Latest member
Vighper

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