Hello all,
I'm struggling with a scenario at present. I'm trying to reconcile our weekly carrier invoices into a flat spreadsheet to be imported into our system. I have compiled a macro in VBA to take our carriers CSV and format into a structure acceptable, the last thing I have to do now is identify when a consignment note is listed more than once, and consolidate their respective values to a single line.
An example is below of what my data currently looks like. Can anyone help with a solution in VBA that will identify the secondary charges for connote 1 and 3, update the value in the first row instance (A2, A4 below) to the sum of each line (there may be more than 2 records), and remove the 2nd or 3rd instance from the workbook? All detail represented by 'xxx' would remain consistent with what is present in the first row the consignment note is found (discard changes such as 'XXz' found in the secondary charges.
From This
To This
I hope this makes sense, and thanks in advance.
I'm struggling with a scenario at present. I'm trying to reconcile our weekly carrier invoices into a flat spreadsheet to be imported into our system. I have compiled a macro in VBA to take our carriers CSV and format into a structure acceptable, the last thing I have to do now is identify when a consignment note is listed more than once, and consolidate their respective values to a single line.
An example is below of what my data currently looks like. Can anyone help with a solution in VBA that will identify the secondary charges for connote 1 and 3, update the value in the first row instance (A2, A4 below) to the sum of each line (there may be more than 2 records), and remove the 2nd or 3rd instance from the workbook? All detail represented by 'xxx' would remain consistent with what is present in the first row the consignment note is found (discard changes such as 'XXz' found in the secondary charges.
From This
AMOUNT | INVOICEDATE | INVOICEID | SHIPMENTID | TAXITEMGROUP | VENDACCOUNT | VENDCONSIGNMENTNUM | VENDORSHIPDATE | WORKER |
19.23 | xxx | xxx | xxx | xxx | xxx | CONNOTE001 | xxx | xxx |
23.01 | xxx | xxx | xxx | xxx | xxx | CONNOTE002 | xxx | xxx |
27.84 | xxx | xxx | xxx | xxx | xxx | CONNOTE003 | xxx | xxx |
26.86 | xxx | xxx | xxx | xxx | xxx | CONNOTE004 | xxx | xxx |
12.65 | xxx | xxx | xxx | xxx | xxx | MANUAL HANDLING ROAD CONNOTE001 | xxx | xxx |
12.65 | xxx | xxx | XXz | xxx | xxx | 2ND DELIV CHARGE CONNOTE001 | xxx | xxx |
12.65 | xxx | xxx | XXz | xxx | xxx | 2ND DELIV CHARGE CONNOTE003 | xxx | xxx |
To This
AMOUNT | INVOICEDATE | INVOICEID | SHIPMENTID | TAXITEMGROUP | VENDACCOUNT | VENDCONSIGNMENTNUM | VENDORSHIPDATE | WORKER |
44.53 | xxx | xxx | xxx | xxx | xxx | CONNOTE001 | xxx | xxx |
23.01 | xxx | xxx | xxx | xxx | xxx | CONNOTE002 | xxx | xxx |
40.49 | xxx | xxx | xxx | xxx | xxx | CONNOTE003 | xxx | xxx |
26.86 | xxx | xxx | xxx | xxx | xxx | CONNOTE004 | xxx | xxx |
I hope this makes sense, and thanks in advance.