I have an array:
The array contains the following data:
(Below, contains data for customer 1.)
-----------------------------------------------------
AllCustomers(1 , 1 ) contains CustomerNo
AllCustomers(1 , 2 ) contains Date
AllCustomers(1 , 3 ) contains Address
.......
........
AllCustomers(1 , 7 ) contains Duration
etc
-----------------------------------------------------
(While, belowcontains data for customer 2.)
-----------------------------------------------------
AllCustomers(2 , 1 ) contains CustomerNo
AllCustomers(2 , 2 ) contains Date
AllCustomers(2 , 3 ) contains Cost
.......
........
AllCustomers(1 , 7 ) contains Duration
etc
-----------------------------------------------------
I want to sort them by CustomerNo which is a string in the format 'M*****', where * is a numeric value.
With a normal, single dimension array I would use Right() on CustomerNo and then sort using these values. However, I want to sort by the CustomerNo (which is in the 2nd dimension), and want all the values that correspond with the customer,
to move with the CustomerNo.
e.g.
unsorted
------------
M00021, 13/02/2005, 80.00,....,....,2
to
M00001, 12/02/2005, 40.00,....,....,1
when sorted
----------------
M00001, 12/02/2005, 40.00,....,....,1
to
M00021, 13/02/2005, 80.00,....,....,2
Any ideas on how to sort this would be greatly appreciated. Just never used more than one dimension before.
Bookmarks