Import data based other workbook's data and filter

CamBF

New Member
Joined
Oct 19, 2023
Messages
11
Office Version
  1. 2016
Hi all,

I'm chasing a VBA macro urgently but don't know how to go about it. Thanks in advance, please see below:

There are 3 documents, I have links to them below:
Doc_1: Loading Google Sheets
Doc_2: Doc_2.xlsm
Doc_3: Loading Google Sheets

What I require is a VBA macro in "Doc_3" which when pushed will prompt the user to find an excel file (in this case "Doc_2") and then another excel file (in this case "Doc_1"). It will then run through the range B8 and down in "Doc_2", as well as range E8 and down in "Doc_2". This will be the assembly marks and quantities required on the job. Then it will go to "Doc_1" and search for each cell value in "Doc_2's" range B8 downwards in "Doc_1's" column A (row 10 downwards). For each assembly mark that it finds in "Doc_1" that matches with range B8 downwards in "Doc_2", I need it to copy the data in columns A-G (and down to just above the next assembly) for that assembly into "Doc_3". I need it to do the same thing for every assembly mark / cell value in "Doc_2's" range B8 downwards. Essentially creating a filtered version of what is shown in "Doc_1" in "Doc_3".

Note that the quantity cell value shown in column C in "Doc_1" 2x cells to the right of the assembly mark is for the whole job and is irrelevant for this macro process. The quantities that need to be used are the quantities to the right of the part mark in column B (located in column C). These will need to be multiplied by the quantities for that assembly in "Doc_2".

I hope that makes sense.
 

Attachments

  • Doc_1 - Screenshot Example.png
    Doc_1 - Screenshot Example.png
    56.3 KB · Views: 20
  • Doc_2 - Screenshot Example.png
    Doc_2 - Screenshot Example.png
    73.2 KB · Views: 29

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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