MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Create Folder


Posted by Zzyzzyth on February 03, 2002 8:15 PM

Could someone help me with the code needed to create a new Folder in the current directory. I am tracking Profit(Loss) spreadsheets and would like to create Fiscal)2, Fiscal03, etc. automatically when the system date changes to our fiscal year.


Posted by John on February 04, 2002 9:23 AM

This will create a new folder in the folder containing your workbook:

Dim FilePath, fs
FilePath = ThisWorkbook.Path
Set fs = CreateObject("Scripting.FileSystemObject")
fs.createfolder (FilePath & "\YourFolderName")


Posted by ZZyzzyth on February 04, 2002 9:42 AM

Thank you so much - this website is a God send!!