Hi all
I have a massive list of data. Which is invoices generated for jobs.
In column A, is a number that is unique per "job" a few columns over is a few value columns for costs.
This is generated automatically by a separate system. What I need to do is have some VBA code to tally all the various cost figures (all separate invoices) for each "job" into a total and delete the other invoices.
Here is a real quick example:
[TABLE="class: grid, width: 500"]
[tr][td][/td][td]A
[/td][td]B
[/td][td]C
[/td][/tr][tr][td]1
[/td][td]Job Number
[/td][td]Cost of Freight
[/td][td]Cost of Services
[/td][/tr][tr][td]2
[/td][td]6BH555
[/td][td]60
[/td][td]60
[/td][/tr][tr][td]3
[/td][td]7BH666
[/td][td]70
[/td][td]70
[/td][/tr][tr][td]4
[/td][td]6BH555
[/td][td]60
[/td][td]60
[/td][/tr][tr][td]5
[/td][td]8BH777
[/td][td]80
[/td][td]80
[/td][/tr][tr][td]6
[/td][td]7BH666
[/td][td]70
[/td][td]70
[/td][/tr][tr][td]7
[/td][td]8BH777
[/td][td]80
[/td][td]80
[/td][/tr]
[/TABLE]
So here we have three unique job numbers, which have 2 invoices each (they could have many invoices, or there could only be one in the real data)
I need code that would turn this into:
[TABLE="class: grid, width: 500"]
[tr][td][/td][td]A
[/td][td]B
[/td][td]C
[/td][/tr][tr][td]1
[/td][td]Job Number
[/td][td]Cost of Freight
[/td][td]Cost of Service
[/td][/tr][tr][td]2
[/td][td]6BH555
[/td][td]120
[/td][td]120
[/td][/tr][tr][td]3
[/td][td]7BH666
[/td][td]140
[/td][td]140
[/td][/tr][tr][td]4
[/td][td]8BH777
[/td][td]160
[/td][td]160
[/td][/tr]
[/TABLE]
As you can see the invoices are tallied together to get a total for the job numbers.
This is what I need but on a mass scale, and of course all the cost values etc are different, there could by many invoices per job, or there could just be one line in which case nothing would need to be tallied.
I know I could code this myself, but it would be a very long winded way as I am coming up blank with efficient ideas on how I would do this.
So any ideas on how to do this efficiently.
Cheers