Sorting Data

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have a workfile that I need to sort by Date and Control Number (Ctl)

The Problem that I am faced with, is that I may have a date 25/04/2007 with Control Number 8045 for say 1000.00. The customer may only pay on say 01/05/2007 on control number 8045.

I would like VBA code that will sort the data by Date, but also group all the control numbers together. In this example it will be as follows


Date Control Number Amount

25/04/2007 8045 1000.00
01/05/2007 8045 -800.00

I have attached sample file. In the sample file the CTL 8322 & 8722 must be grouped together when the data is sorted by date as they are not unique. The balance of the unique records must be sorted by date in ascending order

Your assistance will be most appreciated

Howard
Cash Sales.xls
ABCDEFG
4RefNoJrnDateDateCtlTransamt.balanceAgeing
5A0001SVC15/06/0715/06/200783221443.181443.1841
6A0002SVC09/07/0709/07/20078690650.94650.9417
7A0003SVC10/07/0710/07/200787226148.84 
8A0004REC11/07/0711/07/20078711-188.1-188.115
9A0005GEN16/07/0716/07/20078322-1080 
10A0006SVC17/07/0717/07/200788401449.441449.449
11A0007SVC18/07/0718/07/200788695229.12-403.818
12A0008SVC18/07/0718/07/20078851278.33278.338
13A0009REC18/07/0718/07/20078722-15004648.848
Sheet1
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I seem that you should sort by Ctl / Date (in this order). Is my interpretation correct?

Bye?
 
Upvote 0
Hi Anthony

Your interpretation is correct.

Regards

Howard
 
Upvote 0

Forum statistics

Threads
1,214,405
Messages
6,119,315
Members
448,886
Latest member
GBCTeacher

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