SOLVED

Transferring data from two workbooks into one workbook

%3CLINGO-SUB%20id%3D%22lingo-sub-2070697%22%20slang%3D%22en-US%22%3ETransferring%20data%20from%20two%20workbooks%20into%20one%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2070697%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20no%20background%20in%20VBA%20but%20I%20recently%20learned%20that%20it%20is%20possible%20to%20transfer%20data%20from%20diff%20workbooks%20by%20just%20clicking%20one%20button.%3CBR%20%2F%3E%3CBR%20%2F%3EBackground%3A%20I%20have%20a%20daily%20tasks%20that%20involves%20copying%20data%20from%20two%20workbooks%20(dated%20yesterday%2C%20dated%20today)%20and%20copying%20them%20into%20a%20macro%20that%20compares%20them%20using%20the%20IF%20and%20VLOOKUP%20formulas.%20I%20manually%20copy%20the%20datas%20into%20the%20macro.%3CBR%20%2F%3E%3CBR%20%2F%3EWorksheets%20have%20the%20same%20data%20format%20and%20naming%20convention%2C%20with%20diff%20dates.%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20anyone%20please%20help%20with%20the%20code%3F%20It%20would%20be%20a%20great%20help%20and%20would%20greatly%20minimize%20risks%20of%20human%20errors.%3CBR%20%2F%3E%3CBR%20%2F%3EMicrosoft%20Excel%202016%3CBR%20%2F%3EWindows%2010%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2070697%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2078437%22%20slang%3D%22en-US%22%3ERe%3A%20Transferring%20data%20from%20two%20workbooks%20into%20one%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2078437%22%20slang%3D%22en-US%22%3EI'd%20recommend%20using%20Power%20Query%2C%20it's%20perfect%20for%20this%20sort%20of%20thing.%3CBR%20%2F%3E%3CBR%20%2F%3ESome%20articles%20that%20may%20help%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjDGJhcp4waQ%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjDGJhcp4waQ%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.wiseowl.co.uk%2Fblog%2Fs2536%2Fcompare-query-editor.htm%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.wiseowl.co.uk%2Fblog%2Fs2536%2Fcompare-query-editor.htm%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EMaybe%20the%20Inquire%20Addin%20may%20help%20too%20if%20it's%20purely%20a%20%22What's%20changed%22%20exercise%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fcompare-workbooks-using-spreadsheet-inquire-ebaf3d62-2af5-4cb1-af7d-e958cc5fad42%3Fui%3Den-us%26amp%3Brs%3Den-us%26amp%3Bad%3Dus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fcompare-workbooks-using-spreadsheet-inquire-ebaf3d62-2af5-4cb1-af7d-e958cc5fad42%3Fui%3Den-us%26amp%3Brs%3Den-us%26amp%3Bad%3Dus%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2081298%22%20slang%3D%22en-US%22%3ERe%3A%20Transferring%20data%20from%20two%20workbooks%20into%20one%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2081298%22%20slang%3D%22en-US%22%3EThank%20you%20so%20much%2C%20this%20is%20very%20helpful.%20The%20youtube%20channel%20linked%20also%20has%20many%20helpful%20videos.%3C%2FLINGO-BODY%3E
New Contributor
Hi,

I have no background in VBA but I recently learned that it is possible to transfer data from diff workbooks by just clicking one button.

Background: I have a daily tasks that involves copying data from two workbooks (dated yesterday, dated today) and copying them into a macro that compares them using the IF and VLOOKUP formulas. I manually copy the datas into the macro.

Worksheets have the same data format and naming convention, with diff dates.

Can anyone please help with the code? It would be a great help and would greatly minimize risks of human errors.

Microsoft Excel 2016
Windows 10
3 Replies
Best Response confirmed by Hana2021 (New Contributor)
Solution
I'd recommend using Power Query, it's perfect for this sort of thing.

Some articles that may help
https://www.youtube.com/watch?v=jDGJhcp4waQ
https://www.wiseowl.co.uk/blog/s2536/compare-query-editor.htm



Maybe the Inquire Addin may help too if it's purely a "What's changed" exercise
https://support.microsoft.com/en-us/office/compare-workbooks-using-spreadsheet-inquire-ebaf3d62-2af5...

Thank you so much, this is very helpful. The youtube channel linked also has many helpful videos.

Also, if you want to learn more on Power Query, I have videos here https://youtube.com/playlist?list=PLlHDyf8d156UFChHzgQIO2cdaNqOS8KX3

And I'd highly recommend fellow MVP Oz du Soleil's videos here https://www.youtube.com/c/OzduSoleilDATA/videos