-
-
Save Trshant/7408394 to your computer and use it in GitHub Desktop.
A friend wanted a way to make folders for every day of the year 2012. Made one in python. Another suggested that VBA script is a nicer alternative. This is my first VBA script, Learnt and Written on the fly :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
y = "" | |
MyDate = DateSerial(2012, 1, 1) | |
y = year(MyDate)*10000+month(MyDate)*100+day(MyDate) | |
WScript.echo y | |
objFSO.CreateFolder y | |
For counterVariable = 1 to 366 | |
MyDate1 = DateAdd("d", counterVariable , MyDate ) | |
y = year(MyDate1)*10000+month(MyDate1)*100+day(MyDate1) | |
objFSO.CreateFolder y | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment