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 derfloh 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
Joined
Mar 6, 2009
Messages
12
Location
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
 
What have you tried so far, and where are you stuck?
 
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]
 
THX it works and it isn't very difficult
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top