Making new Directories

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
I have an workbook that will save as as required. I know how to make a specific directory with the MkDir code but here's where I get stuck. I'd like a piece of code that will check for the number in a specific cell (let's say Sheet1, Cell "A1") and will make a new folder if and only if the number doesn't fall in one of the previously made folders. These folders should range in increments of 50 (example- 1-50, 51-100, 101-150, Etc etc) and obviously if the folder is already created, then save in that folder, and if it doesn't exist, create it and save. A1 might have a number like 74, in which case it either makes folder 51-100 and saves it or just saves if the cell already exists. I have the coding for the C:\Users\Bridge\Desktop\Noon\ portion of the save as but i don't know the mkdir part.

thanks
 

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.
I appreciate the idea but no go. I need excel to save in the right folder based on the number (range) of sheet1cellA1 and more importantly, if the folder doesn't exist, it needs to make it but it needs to make it based on ranges of 50.
 
Upvote 0

Forum statistics

Threads
1,215,184
Messages
6,123,533
Members
449,106
Latest member
techog

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