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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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