Hi,
I have a workbook that I have created that imports data from 4 other workbooks and lists the data on the "Data" sheet, what I would like to have is a macro that will look through all the rows on this sheet and if it finds matches of data in 4 columns then have a message box pop up asking if the match would like to be comnined, if yes then the values for the matching rows in columns G & K be added together and entered into the first matching row and then the other matching rows deleted, the macro would then need to check if there are any other matches as there may be more than 1
See example of before and after
Excel 2010
I have a workbook that I have created that imports data from 4 other workbooks and lists the data on the "Data" sheet, what I would like to have is a macro that will look through all the rows on this sheet and if it finds matches of data in 4 columns then have a message box pop up asking if the match would like to be comnined, if yes then the values for the matching rows in columns G & K be added together and entered into the first matching row and then the other matching rows deleted, the macro would then need to check if there are any other matches as there may be more than 1
See example of before and after
Excel Workbook | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | |||
1 | Machine | Index | Start | Customer | Filler | Ammount | Code | % | No Bags | |||
2 | 14 | 1 | 00:00 | Fred | fudge | 100 | fu1 | 10 | 10 | |||
3 | 14 | 2 | 00:50 | Bill | cream | 200 | cr1 | 10 | 20 | |||
4 | 14 | 5 | 02:10 | Ellen | cream | 250 | cr1 | 10 | 25 | |||
5 | 34 | 8 | 00:00 | Bob | fruit | 50 | fr1 | 20 | 10 | |||
6 | 34 | 15 | 06:00 | Dave | mix | 300 | mx1 | 20 | 60 | |||
7 | 34 | 18 | 07:00 | Ed | chocolate | 200 | ch1 | 5 | 10 | |||
8 | 34 | 20 | 08:00 | Will | chocolate | 500 | ch1 | 5 | 25 | |||
Sheet1 |
Excel Workbook | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | |||
1 | Machine | Index | Start | Customer | Filler | Ammount | Code | % | No Bags | |||
2 | 14 | 1 | 00:00 | Fred | fudge | 100 | fu1 | 10 | 10 | |||
3 | 14 | 2 | 00:50 | Bill | cream | 450 | cr1 | 10 | 45 | |||
4 | 34 | 8 | 00:00 | Bob | fruit | 50 | fr1 | 20 | 10 | |||
5 | 34 | 15 | 06:00 | Dave | mix | 300 | mx1 | 20 | 60 | |||
6 | 34 | 18 | 07:00 | Ed | chocolate | 700 | ch1 | 5 | 35 | |||
Excel 2010
Sheet2 |