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

mkseto

New Member
Joined
Aug 14, 2018
Messages
15
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 to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,127
Messages
5,768,275
Members
425,460
Latest member
Astros1243

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
Top