Macro: Automating the importation of data into Excel from variable sources/pathway

mlikoudis

New Member
Joined
Aug 14, 2019
Messages
7
Hi all,

Basically I want to automate the importation of a Text/CSV file into my Excel. The problem that I am having is that the pathway and file name of my source changes on monthly basis.

For example:
For the month of January, a January folder is created where all the data in dumped in. So the source file name would be something like "Data_Jan_2019". Next month, another folder is created (February) and all the data relating to that month.

Seeing as my pathway and source file name is not constant, how can I automate this? Is there a way to program excel to say: If the month and year in the sheet is Jan 2019, go get the file from the folder January 2019

***Note: I have recently started playing around with VBA. I'm a complete rookie. For the time-being, I am "manually" recording my Macros and later going to observe the VBA code to learn.***

Thank you for your patience!
 

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,224,817
Messages
6,181,144
Members
453,021
Latest member
Justyna P

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