(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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
.
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
 
Upvote 0
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
 
Upvote 0
...
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:
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

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