Copy worksheets from different directory to current workbook

Pumper

Board Regular
Joined
Sep 12, 2013
Messages
95
Office Version
  1. 2016
Hi All,

I am attempting to use VBA to search a directory for files that contain certain text and yesterdays date in the file name (date format is dd-mmm-yyyy, work days only ideally) and paste into the current workbook.

Have found similar threads here but not quite the same and after countless videos and attempts I am asking the experts :)

All of the source files are in the same directory G:\Data\Prices​
Current workbook where the data should be copied to is called Master.xlsm and is in G:\All\Masterfiles​
If the file name contains the text "Warning" and yesterdays date then copy to the current workbook in tab "Check" in cell A1​
If the file name contains the text "Direct" and yesterdays date then copy to the current workbook in tab "Exposure" in cell A2 (has a heading in row 1 so needs to be from A2)​
Any assistance is much appreciated, even a link to a similar example would be helpful.

Thanks in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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