How to use VBA to merge 2 sheets into one with the same ID
Attachment 15507
Attachment 15508
Attachment 15509 <- there is the expected result.
Thanks!
How to use VBA to merge 2 sheets into one with the same ID
Attachment 15507
Attachment 15508
Attachment 15509 <- there is the expected result.
Thanks!
give this a spin
They are not SQL.
The data stored in Excel only.
It should not involved in SQL.
Can : stSQLstring = "Select [Sheet1$].[ID], [Sheet1$].[Name], " & _ "[Sheet2$].[Purchase] From " & _
"([Sheet1$] Left Join [Sheet2$] On " & _
"[Sheet1$].[ID] = [Sheet2$].[ID]);"
do the mapping?
Anyway, thank you for your help!:yes
Have you try running it? Yes, I used SQL to extract, that is the beauty of programming, if you know how to do it, you can do anything.
Put your info onto Sheet1 and Sheet2 just like what you have in your question and run the code. (never mind - I already did this for you - so just run the code)
Tried. Thanks anyway. Going to understand it and reproduct it!