Is it possible to create a directory from an Excel macro. If so, please could someone let me have the relevant code, I need to create a directory eg. C:\book1 and then save book1.xls within this new folder.
Have a look at VBA general help on MkDir:
Creates a new directory or folder.
Syntax
MkDir path
The required path argument is a string expression that identifies the directory or folder to be created. The path may include the drive. If no drive is specified, MkDir creates the new directory or folder on the current drive.
Here's their code example:
Code:
MkDir "MYDIR" ' Make new directory or folder
If uou don't specify Fullpath the Directory is created in Excel's current directory (check what that is by using
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.