Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to generate monthly 2

Status
Not open for further replies.

causative

Technical User
Mar 6, 2009
12
PL
Hello
I need your help with the script.
I want to create monthly folders for example: Jan14, Feb14, March14 and so.... for one year
Is it possible to do?

Thx in advice
 
Hi
thx for replay
So far I have tried:

Code:
strFolder = Month(date) & "_" & Year(date)
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CreateFolder(strFolder)

I'm not a programmer so my code is very simple
 
Hi,

Do you really want folders named like that ie mmmyy?

If you were to sort the folders, April & August would collate before January & February!
 
You have a right SkipVought, guitarzan.
It would make problems with sorting, so mmyy is OK, but how to generate 12 folders not just a one?
 
Use a loop:
Code:
[highlight #FCE94F]For x = 1 to 12[/highlight]
   strFolder = MonthName([highlight #FCE94F]x[/highlight], True) & "_" & Year(date) 
   objFSO.CreateFolder(strFolder) 
[highlight #FCE94F]Next[/highlight]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top