VBA find differences in 2 worksheets

weissihm

New Member
Joined
May 21, 2015
Messages
8
I have two large worksheets. One was run a couple months ago and the other was run this week. I'm looking for VBA to find the differences between the worksheets. Each worksheet is set up the same, but the data may not be in the same order, and may not have the exact same items.

Spreadsheets have about 60,000 rows and 50 columns.

Small set of Original data
INMIDINMDescINMCatINMUnitINMAltEntryConvFactINMAltEntryUOMINMForceSalesEntryINMCommentINMFarmerTaxINMLastCostINMLastVendorINMMinimumINMNoAnonymousINMPrice1
258E-07GREEN ENGRAVED 3113EA
False​
Y
0.8467​
889810
0.0000​
False​
2.0500​
258E-03NECK TAG ENGRAVED WHITE TAG W/ BLACK #3050EA
0.0000​
False​
Y
1.1011​
889810
0.0000​
False​
2.5900​
1BURNS 1' HYD HOSE3240FT
0.0000​
False​
Y
9.25
605210
0.0000​
False​
8.9900​
07.05114PUMP 07.05114 -DI3050EA
False​
Y
0.0000​
0.0000​
False​
232.9500​
07.06772VENTIER PURPLE -DI3050EA
False​
Y
0.0000​
0.0000​
False​
8.2000​
07.06773TURBO DROP BLUE3050EA
0.0000​
False​
Y
0.0000​
0.0000​
False​
13.2900​
07.06839SPRAYER PART3240EA
False​
Y
0.0000​
0.0000​
False​
2.5500​
07.06967BUSHING3050EA
False​
Y
0.0000​
0.0000​
False​
4.9500​
07.06995SPRAYER PART3050EA
False​
Y
0.0000​
0.0000​
False​
3.1900​

Updated Data
INMIDINMDescINMDescINMCatINMUnitINMAltEntryConvFactINMAltEntryUOMINMForceSalesEntryINMCommentINMFarmerTaxINMLastCostINMLastVendorINMMinimumINMNoAnonymousINMPrice1
258E-07GREEN ENGRAVED NECK TAGGREEN ENGRAVED NECK TAG3113EACH
False​
Y
0.8467​
889810
0.0000​
False​
2.0500​
258E-03NECK TAG ENGRAVED WHITE TAG W/ BLACK #NECK TAG ENGRAVED WHITE TAG W/ BLACK #3050EACH
0.0000​
False​
Y
1.1011​
889810
0.0000​
False​
2.5900​
1BURNS 1' HYD HOSEBURNS 1' HYD HOSE3240FOOT
0.0000​
False​
Y
9.25
605210
0.0000​
False​
8.9900​
07.05114PUMP 07.05114 -DIPUMP 07.05114 -DI3050EACH
False​
Y
0.0000​
0.0000​
False​
232.9500​
07.06772VENTIER PURPLE -DIVENTIER PURPLE -DI3050EACH
False​
Y
0.0000​
0.0000​
False​
8.2000​
07.06773TURBO DROP BLUETURBO DROP BLUE3050EACH
0.0000​
False​
Y
0.0000​
0.0000​
False​
13.2900​
07.06839SPRAYER PARTSPRAYER PART3240EACH
False​
Y
0.0000​
0.0000​
False​
2.5500​
07.06967BUSHINGBUSHING3050EACH
False​
Y
0.0000​
0.0000​
False​
4.9500
07.06995SPRAYER PARTSPRAYER PART3050EACH
False​
Y
0.0000​
0.0000​
False​
3.1900​

I highlighted a few of the differences on the updated data, in red as a way to show what I need to find.

I don't care if one of the existing worksheets highlights the differences or if the differences are dumped to another sheet, I just need to be able find the differences.

I am on Windows 10, Microsoft 365.

Thank you in advance.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
There must be one or several references as comparison variable.
Is it just the INMID column need to be matched? Comparing List1 to List2 will find what is in List1 not available in List1 but if you compare List2 to List1, the result is different.
 
Upvote 0
There must be one or several references as comparison variable.
Is it just the INMID column need to be matched? Comparing List1 to List2 will find what is in List1 not available in List1 but if you compare List2 to List1, the result is different.
Sorry, I didn't specify that. INMID is the column that needs to be matched. I want to compare List 2 to List 1 to see what changed since List 1 was ran first.
 
Upvote 0
Your column titles are also not in sync (not same sequence)? 50 columns instead of 14 shown in top table? You have two column with same title in 2nd table?
 
Upvote 0
I'm not sure why the second column of named INMDesc is showing, it is not on my original set of data. Must have been something with the copy and paste. The reason I only show 14 columns is to give a sample of what I'm doing. Some of the spreadsheets I need to compare are less than 50 columns. I was able to get XL2BB to work, so I included a sample of the data, showing all of the columns. You will see on the Updated Data file the items in red text are changes that I'm looking for the VBA to find and distinguish for me.

Background on this: We are moving to a new software and these are our items. I have already sent a list of items to the software company to get into the system, however as we get closer to go live, I need to provide the software company updated data showing any changes that have taken place since the original data was sent.

Original Data
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDE
1INMIDINMDescINMCatINMUnitINMAltEntryConvFactINMAltEntryUOMINMForceSalesEntryINMCommentINMFarmerTaxINMLastCostINMLastVendorINMMinimumINMNoAnonymousINMPrice1INMPrice2INMPrice3INMPrice4INMQtyBrk2INMQtyBrk3INMQtyBrk4INMPriceSuggRetailINMReminderINMDiscontinuedINMReplacementItemIDINMSaleCommentINMSerialINMServiceRevenueINMStatusINMTaxableINMTypeINMVendor1INMWeightINMWorkInstructionsINMCompanionINMCompanionMatchINMFractPriceINMFuelINMOilEnergyTypeINMRestrFuelINMDensityINMLiquidDensityINMApplicationRateINMAppRateUOMINMBlendConvFactINMBlendUOMINMBushelWeightINMCDMSIDINMChemicalKitINMComplexFertINMEPANumberINMEPATier2INMGrainItemINMLotINMManufacturerINMMFItemINMMSDSINMPhosphateINMPotashINMPrecisionAgINMPrecisionStdConvINMPrecisionStdUOMINMRestrChemINMSulphurINMTonnageTaxINMUreaNitrogenINMAssemblyINMAOBuildTypeINMAOMarkupPriceTonINMIngredientINMInScaleWeightINMMarketCostINMMedicatedFeedINMMixerItemIDINMNewPrice1INMNewPrice2INMNewPrice3INMNewPrice4INMNewQtyBrk2INMNewQtyBrk3INMNewQtyBrk4INMP1FactorINMP1Factor2INMP1InputINMP1ModelINMP1OperatorINMP1Operator2INMP2FactorINMP2Factor2INMP2InputINMP2ModelINMP2OperatorINMP2Operator2INMP3FactorINMP3Factor2INMP3InputINMP3ModelINMP3OperatorINMP3Operator2INMP4FactorINMP4Factor2INMP4InputINMP4ModelINMP4OperatorINMP4Operator2INMPriceAtMarketINMPriceRuleINMUseBOMFuturePriceINMVFDRequiredINMWEMScaleID
2258E-07GREEN ENGRAVED3113EAFalseY0.84678898100.0000False2.0500FalseFalseFalseATrueI8898100.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
3258E-03NECK TAG ENGRAVED WHITE TAG W/ BLACK #3050EA0.0000FalseY1.10118898100.0000False2.59000.00000.00000.00000000.0000FalseFalseFalseATrueI0207900.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
41BURNS 1' HYD HOSE3240FT0.0000FalseY9.51316052100.0000False8.99000.00000.00000.00000000.0000FalseFalseFalseATrueI2129900.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
507.05114PUMP 07.05114 -DI3050EAFalseY0.00000.0000False232.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
607.06772VENTIER PURPLE -DI3050EAFalseY0.00000.0000False8.2000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
707.06773TURBO DROP BLUE3050EA0.0000FalseY0.00000.0000False13.29000.00000.00000.00000000.0000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
807.06839SPRAYER PART3240EAFalseY0.00000.0000False2.5500FalseFalseFalseATrueI2129900.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00False0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
907.06967BUSHING3050EAFalseY0.00000.0000False4.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1007.06995SPRAYER PART3050EAFalseY0.00000.0000False3.1900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1107.07144TIP3050EAFalseY0.00000.0000False4.2200FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1207.07342SPRAYER PART3050EAFalseY0.00000.0000False56.4900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1307.07963HANDLE3050EAFalseY0.00000.0000False13.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1407.08041SPRAYER PART3050EAFalseY0.00000.0000False1.1000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1507.081891.5 CAP POLY -DI3050EAFalseY0.00000.0000False12.6900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1607.09541CREEN 07.095413050EAFalseY0.00000.0000False39.0000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1707.10256BUSHING 07.102563050EAFalseY0.00000.0000False3.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1807.10260BUSHING3050EAFalseY0.00000.0000False4.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1907.10276BUSHING 07.102763050EAFalseY2.91008027300.0000False6.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
2007.10279SPRAYER PART3050EAFalseY0.00000.0000False0.8900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
Original


Updated Data
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDE
1INMIDINMDescINMCatINMUnitINMAltEntryConvFactINMAltEntryUOMINMForceSalesEntryINMCommentINMFarmerTaxINMLastCostINMLastVendorINMMinimumINMNoAnonymousINMPrice1INMPrice2INMPrice3INMPrice4INMQtyBrk2INMQtyBrk3INMQtyBrk4INMPriceSuggRetailINMReminderINMDiscontinuedINMReplacementItemIDINMSaleCommentINMSerialINMServiceRevenueINMStatusINMTaxableINMTypeINMVendor1INMWeightINMWorkInstructionsINMCompanionINMCompanionMatchINMFractPriceINMFuelINMOilEnergyTypeINMRestrFuelINMDensityINMLiquidDensityINMApplicationRateINMAppRateUOMINMBlendConvFactINMBlendUOMINMBushelWeightINMCDMSIDINMChemicalKitINMComplexFertINMEPANumberINMEPATier2INMGrainItemINMLotINMManufacturerINMMFItemINMMSDSINMPhosphateINMPotashINMPrecisionAgINMPrecisionStdConvINMPrecisionStdUOMINMRestrChemINMSulphurINMTonnageTaxINMUreaNitrogenINMAssemblyINMAOBuildTypeINMAOMarkupPriceTonINMIngredientINMInScaleWeightINMMarketCostINMMedicatedFeedINMMixerItemIDINMNewPrice1INMNewPrice2INMNewPrice3INMNewPrice4INMNewQtyBrk2INMNewQtyBrk3INMNewQtyBrk4INMP1FactorINMP1Factor2INMP1InputINMP1ModelINMP1OperatorINMP1Operator2INMP2FactorINMP2Factor2INMP2InputINMP2ModelINMP2OperatorINMP2Operator2INMP3FactorINMP3Factor2INMP3InputINMP3ModelINMP3OperatorINMP3Operator2INMP4FactorINMP4Factor2INMP4InputINMP4ModelINMP4OperatorINMP4Operator2INMPriceAtMarketINMPriceRuleINMUseBOMFuturePriceINMVFDRequiredINMWEMScaleID
2258E-07GREEN ENGRAVED NECK TAG3113EACHFalseY0.84678898100.0000False2.0500FalseFalseFalseATrueI8898100.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
3258E-03NECK TAG ENGRAVED WHITE TAG W/ BLACK #3050EACH0.0000FalseY1.10118898100.0000False2.59000.00000.00000.00000000.0000FalseFalseFalseATrueI0207900.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
41BURNS 1' HYD HOSE3240FOOT0.0000FalseY9.25006052100.0000False8.99000.00000.00000.00000000.0000FalseFalseFalseATrueI2129900.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
507.05114PUMP 07.05114 -DI3050EACHFalseY0.00000.0000False232.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
607.06772VENTIER PURPLE -DI3050EACHFalseY0.00000.0000False8.2000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
707.06773TURBO DROP BLUE3050EACH0.0000FalseY0.00000.0000False13.29000.00000.00000.00000000.0000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.00000.0000L0.00000FalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00.00000True0.0000False0.00000.00000.00000.00000000.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
807.06839SPRAYER PART3240EACHFalseY0.00000.0000False2.5500FalseFalseFalseATrueI2129900.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00False0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
907.06967BUSHING3050EACHFalseY0.00000.0000False4.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1007.06995SPRAYER PART3050EACHFalseY0.00000.0000False3.1900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1107.07144TIP3050EACHFalseY0.00000.0000False4.2200FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1207.07342SPRAYER PART3050EACHFalseY0.00000.0000False56.4900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1307.07963HANDLE3050EACHFalseY0.00000.0000False13.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1407.08041SPRAYER PART3050EACHFalseY0.00000.0000False1.1000FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1507.081891.5" CAP POLY -DI3050EACHFalseY0.00000.0000False12.6900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1607.09541CREEN 07.095413050EACHFalseY0.00000.0000False41.9900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1707.10256BUSHING 07.102563050EACHFalseY0.00000.0000False3.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1807.10260BUSHING3050EACHFalseY0.00000.0000False4.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
1907.10276BUSHING 07.102763050EACHFalseY2.91008027300.0000False6.9500FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
2007.10279SPRAYER PART3050EACHFalseY0.00000.0000False0.8900FalseFalseFalseATrueI0060580.0000FalseTrueFalseFalseFalse00.0000LFalseFalseFalseFalse00.00000.0000False1.0000OFalse0.000000.0000False00True0.0000False0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0.00000.0000NN/+0MFalse0
Updated
 
Upvote 0
You have huge data here. I'm suing Dictionary object to loop faster and once found match, I deleted the matched item so the looping will become less and less and get faster towards the end.
For column D, EA and EACH, FT and FOOT are not the same and so I just don't bother about them. This go to 100 columns but you can change in this line

For nCol = 2 To 100

See if this code works

VBA Code:
Sub Compare()

Dim nCol&, eRow1&, eRow2&
Dim StartTime#, SecondsElapsed#
Dim key1, key2, INMID1, INMID2
Dim rngINMID1 As Range, rngINMID2 As Range
Dim DictINMID1 As Object, DictINMID2 As Object
Dim ws1 As Worksheet, ws2 As Worksheet

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

StartTime = Timer

' Change sheetname accodingly if not Sheet1 and Sheet2
Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")

' Create Dictionary for each INMID
Set DictINMID1 = CreateObject("Scripting.Dictionary")
Set DictINMID2 = CreateObject("Scripting.Dictionary")

' Fine last row of lists
eRow1 = ws1.Range("A1").End(xlDown).Row
eRow2 = ws2.Range("A1").End(xlDown).Row

' Define range for each INMID
Set rngINMID1 = ws1.Range("A2", "a" & eRow1)
Set rngINMID2 = ws2.Range("A2", "a" & eRow2)

' Load data into INMID Dictionary
For Each INMID1 In rngINMID1
    DictINMID1.Add INMID1.Value, INMID1.Row
Next
For Each INMID2 In rngINMID2
    DictINMID2.Add INMID2.Value, INMID2.Row
Next

' Loop through Dictionaries values
For Each key1 In DictINMID1
    For Each key2 In DictINMID2
        If key1 = key2 Then
            ' Shade every 3rd row for ease of visualization
            If DictINMID2(key2) Mod 3 = 1 Then
                ws2.Range("A" & DictINMID2(key2), "BC" & DictINMID2(key2)).Interior.ColorIndex = 15
            End If
            ' Mark difference for remaining columns (49 columns) in the row where INMIDs matched
            For nCol = 2 To 100
                If Not ws1.Cells(DictINMID1(key1), nCol) = ws2.Cells(DictINMID2(key2), nCol) Then
                    ws2.Cells(DictINMID2(key2), nCol).Font.ColorIndex = 3
                End If
            Next
            ' Removing the matched key2 from list and exit loop
            DictINMID2.Remove key2
            Exit For
        End If
    Next
Next

'Determine how many seconds code took to run
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
  
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub
 
Upvote 0
Solution
I tried your code on the small set of data, after I purposely made more changes and it seems to work perfectly! This will save me a ton of time. I can't thank you enough. AWESOME!!!
 
Upvote 0
I tried your code on the small set of data, after I purposely made more changes and it seems to work perfectly! This will save me a ton of time. I can't thank you enough. AWESOME!!!
Good to hear it works. Thanks for update.... and yes I expected you to made modification to your requirement. Highlight columns and marked columns are not the same either ?
 
Upvote 0

Forum statistics

Threads
1,224,884
Messages
6,181,558
Members
453,053
Latest member
Kiranm13

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