aravindh8686
New Member
- Joined
- Oct 31, 2018
- Messages
- 5
I have two workbooks M.xlsx and Lable DB.xlsm. I need VBA to compare this two workbook column A which has matching values, and when values are matched copy the corresponding Col B and Col C datas from Lable DB.xlsm to the matched value of M.xlsx workbook.
Some condition:
I searched lot in online and tried to use some codes which may satisfy my requirement, but I couldnt rightly choose since I am not more familiar with codes. Kindly help.
M.xlsx looks like
COL A COL B COL C
<tbody>
</tbody>
Lable DB.xlsm workbook looks like
COL A COL B COL C
<tbody>
</tbody>
Expected result in M.xlsx
COL A COL B COL C
<tbody>
</tbody>
Some condition:
- I will place both files in one folder.
- M.xlsx , workbooks worksheet name may be different each time.And it may not be open all time.
- Macro will be runned from Lable DB.xlsm
- After pasting datas to M.xlsx, it will save and close the workbook.
I searched lot in online and tried to use some codes which may satisfy my requirement, but I couldnt rightly choose since I am not more familiar with codes. Kindly help.
M.xlsx looks like
COL A COL B COL C
FPSMC | | |
62/85R2 | | |
74DC | | |
85R2 | | |
86F-2 | | |
CFL | | |
DS1 | | |
<tbody>
</tbody>
Lable DB.xlsm workbook looks like
COL A COL B COL C
62/85R2 | SYS1 | |
74DC | SYS2 | |
85R2 | SYS5 | DATABASE |
FPSMC | SYS8 | BLOCK |
CFL | SYS6 | |
DS1 | SYS3 | DB3 |
86F-2 | SYS9 | CKT |
<tbody>
</tbody>
Expected result in M.xlsx
COL A COL B COL C
FPSMC | SYS8 | BLOCK |
62/85R2 | SYS1 | |
74DC | SYS2 | |
85R2 | SYS5 | DATABASE |
86F-2 | SYS9 | CKT |
CFL | SYS6 | |
DS1 | SYS3 | DB3 |
<tbody>
</tbody>