I'm trying to compare the values of columns B and G and if any of the cells are G < B, I would like to move the whole row into the second worksheet. And only if possible, it would be awesome if the macro could check column A for duplicates before the value comparison and sum up the column B if there are duplicates. In my example row 6 and 7 on column A have the same suppliers code and the amount totals to 2.
In this case for example, the value of the third row of G is lower than B, and therefore I would like the whole row 3 to be cut out from worksheet 1 and moved to worksheet 2.
I've tried making my own macros from other examples, but haven't really found anything that would suite my needs and fulfill the objective. I would be so thankful for any help provided! I understand that this might seem really complicated since I'm not that good at phrasing my problem .
Original view of sheet 1:
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
The macro would first make the sheet look like:
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
And then cut out the rows in which G<B, so the sheet 1 would look like:
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
And Sheet 2:
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
In this case for example, the value of the third row of G is lower than B, and therefore I would like the whole row 3 to be cut out from worksheet 1 and moved to worksheet 2.
I've tried making my own macros from other examples, but haven't really found anything that would suite my needs and fulfill the objective. I would be so thankful for any help provided! I understand that this might seem really complicated since I'm not that good at phrasing my problem .
Original view of sheet 1:
SUPPLIERSCODE | ORDERAMOUNT | PRODUCTNAME | BARCODE | SUPPLIERSCODE | WAREHOUSE STOCK | |
1234 | 2,00 | TEST PRODUCT 1 | 9999999 | 1234 | 2,00 | |
1235 | 4,00 | TEST PRODUCT 2 | 9999999 | 1235 | 3,00 | |
1236 | 1,00 | TEST PRODUCT 3 | 9999999 | 1236 | 1,00 | |
1237 | 1,00 | TEST PRODUCT 4 | 9999999 | 1237 | 1,00 | |
1238 | 1,00 | TEST PRODUCT 5 | 9999999 | 1238 | 1,00 | |
1238 | 1,00 | TEST PRODUCT 5 | 9999999 |
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
The macro would first make the sheet look like:
SUPPLIERSCODE | ORDERAMOUNT | PRODUCTNAME | BARCODE | SUPPLIERSCODE | WAREHOUSE STOCK | |
1234 | 2,00 | TEST PRODUCT 1 | 9999999 | 1234 | 2,00 | |
1235 | 4,00 | TEST PRODUCT 2 | 9999999 | 1235 | 3,00 | |
1236 | 1,00 | TEST PRODUCT 3 | 9999999 | 1236 | 1,00 | |
1237 | 1,00 | TEST PRODUCT 4 | 9999999 | 1237 | 1,00 | |
1238 | 2,00 | TEST PRODUCT 5 | 9999999 | 1238 | 1,00 |
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
And then cut out the rows in which G<B, so the sheet 1 would look like:
SUPPLIERSCODE | ORDERAMOUNT | PRODUCTNAME | BARCODE | SUPPLIERSCODE | WAREHOUSE STOCK | |
1234 | 2,00 | TEST PRODUCT 1 | 9999999 | 1234 | 2,00 | |
1236 | 1,00 | TEST PRODUCT 3 | 9999999 | 1236 | 1,00 | |
1237 | 1,00 | TEST PRODUCT 4 | 9999999 | 1237 | 1,00 |
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
And Sheet 2:
1235 | 4,00 | TEST PRODUCT 2 | 9999999 | 1235 | 3,00 | |
1238 | 2,00 | TEST PRODUCT 5 | 9999999 | 1238 | 1,00 |
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
Last edited: