Identifying and Creating a Date Folder. Tricky Macros

seraaj

New Member
Joined
Mar 4, 2015
Messages
4
Hi Everyone,

Hope all is well.

I require code to create folders in a specific drive.
The code must do the following:
Go into folder path \\Server\Main Folder\Data Loads\
- If today is the 1st March, I have to save 5 files in a folder "February 2015' in a subfolder "20150228". So always the day before

The code must check if folder "February 2015" exists. If it does exist, check subfolders if folder "20150228" Exists. If not create it and save files in it.

Therefore:
- If today is the 2nd March, I have to save 5 files in a folder Dataloads/March 2015/20150301.
- If today is Monday 2nd March, I have to save 5 files in a folder Dataloads/March 2015/20150227 (Friday past).

I have code but its crap and deleted all my work and i'm afraid to use it.:warning:

This is a daily task so months changing and years changing needs to be considered too.

Please assist :)

Thank you kindly.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

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