Seperate prompts for user to select 2 Excel files for import and change sheet names

mkseto

New Member
Joined
Aug 14, 2018
Messages
38
Hi,
New to VBA, hope someone can help.
I need a macro to do the following:
1) Prompt user to select an Excel file (i.e. xls or csv)
2) Import the above select file as a new worksheet in the active workbook and change the worksheet name to "GOOD"
3) Repeat "1" and "2" above and rename the imported worksheet to "BAD"
4) For each cell in column "A" in the "GOOD" worksheet (except the column header at top), lookup column "H" of the "BAD" worksheet and:
a) if not found (in column "H" of "BAD"), insert word "Missing" in column "K" of the respective row in "GOOD"
b) if found, compare the value of in column "B" to the value of the value in column "J" of the matched record in "BAD":
i) if matched, insert word "MATCHED" in column "K" of the respective row in "GOOD"
ii) if it doesn't match, insert word "CHECK" in column "K" of the respective row in "GOOD"

I'm hoping to get the codes for "1" to "3" above, which is probably piece-of-cake for most of you (but not me, not even after searching for hours in various forums).

Thanks in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,215,541
Messages
6,125,413
Members
449,223
Latest member
Narrian

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