I have an unknown number of entries (rows) contained in 12 worksheets (1 per month). These rows track delivery data. I want to parse through each row, of each sheet and do the following:
Tally the number of deliveries from A to B. Tally the number of pieces from A to B. Tally the cost of delivery from A to B. Tally the total cargo weight from A to B.
These tally's need to be output to a summary worksheet and need to be both Monthly and YTD.
Sample columns, and a single data row, are as follows:
Date&Time PU | Date&Time Del |PU Loc. Name |PU Street |PUCityStateZip |DEL Loc. Name|DEL Street |DELCityStateZip |Number of Pieces|Weight |TotalAmt
01/01/2016 05:30 | 01/01/2016 07:30 | Warehouse A | 123 Nowhere St. | Toronto, ON P3L 3M0 | Hospital A | 321 Made-up Ave. | Stratford, ON T45 6H8 | 6 | 240 Lbs | $245.00
02/01/2016 06:30 | 02/01/2016 07:30 | Warehouse B | 123 Lost Road | Hamilton, ON P3X 3Z0| Hospital A | 321 Made-up Ave. | Stratford, ON T4P 6H8 | 3 | 240 Lbs | $245.00
01/01/2016 09:30 | 02/01/2016 11:30 | Warehouse A | 123 Nowhere St. | Toronto, ON P3L 3M0 | Hospital B | 123 Boul Fake. | Montreal, QC T4Y 6J8 | 1 | 24 Lbs | $45.00
04/01/2016 05:30 | 04/01/2016 07:30 | Warehouse A | 123 Nowhere St. | Toronto, ON P3L 3M0 | Hospital A | 321 Made-up Ave. | Stratford, ON T4P 6H8 | 4 | 160 Lbs | $145.00
Using the sample data above we would have(for total number of deliveries):
2 Deliveries from Warehouse A to Hospital A
1 Delivery from Warehouse B to Hospital A
1 Delivery from Warehouse A to Hospital B
I know how to cycle through the different worksheets. I also know how to cycle through to the end of the last row, in an unknown number of rows.
I do not know the best way to sort through my data and compare pick-up and delivery locations. ie. I need to be able to look through the data to determine that Warehouse A delivered to Hospital B 7 times in the month of January, 15 times in February...10 times in December etc.. I have no code for this done up, at this point, because I'm having issues visualising how best to approach this.
This must be a VBA solution--I could have this done by hand ages ago but I want an "automated" VBA solution.
Any assistance is appreciated.