Loop through two columns and paste matching cells to a new sheet

bspaulding45

New Member
Joined
Jan 13, 2015
Messages
14
Hello,

I was wondering if I could get some help. I seem confused on how to create a VBA code for a specific function I am working on. I am a beginner, so I apologize. I have searched here and Google, but it seems to be confusing me more and more as I search.

Anyways, here is what I am trying to achieve. I have two worksheets. WS1 is opened first and when I run the macro, it will open a specified WS2 in a folder. When WS2 is open, I need to compare Column A from WS1 to Column D in WS2. If there are any matches, I need to copy the cell value in Column D from WS1 to a new worksheet. I have tried using a 'for each cell in' method and cannot seem to get it to work. Can someone guide me down the right path, please? Any and all help will be greatly appreciated. Thank you.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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