Macro required

Damo10

Active Member
Joined
Dec 13, 2010
Messages
460
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 Workbook
BCDEFGHIJK
1MachineIndexStartCustomerFillerAmmountCode%No Bags
214100:00Fredfudge100fu11010
314200:50Billcream200cr11020
414502:10Ellencream250cr11025
534800:00Bobfruit50fr12010
6341506:00Davemix300mx12060
7341807:00Edchocolate200ch1510
8342008:00Willchocolate500ch1525
Sheet1
Excel Workbook
BCDEFGHIJK
1MachineIndexStartCustomerFillerAmmountCode%No Bags
214100:00Fredfudge100fu11010
314200:50Billcream450cr11045
434800:00Bobfruit50fr12010
5341506:00Davemix300mx12060
6341807:00Edchocolate700ch1535
Excel 2010 Sheet2
Excel 2010
 
Just to recap, if I've got it right !!! Your extra code just looked for data in column "A", which was there anyway and therefore did not change anything.
The criteria for the code:-
From trying to read back the code, it appears:-
Dic1 was essentially based on columns C,D,G,J & K being the same (with column "O" being 4 , an no "n" in column "B"), Dic2 was based on the same columns except column "D", so if the code found rows that where the same except for column D then it tried to combine them.
At the moment thats what the code wants to do , what do you want it to do ????
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top