Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I need an excel sheet to creating a new folder every month, and save a new spreadsheet every day, untill the next month, when it creates a new folder

So for every day in sep, it will save a file to the folder marked "Sep
2006", then in Oct it will create a new folder "Oct 2006" and save
there for the rest of the month.

Thanks for your help in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default I need an excel sheet to creating a new folder every month, and save a new spreadsheet every day, untill the next month, when it creates a new folder

Try this macro

It create the folder in C
Change monthnumber = 9 to the month you want
It save a copy of the workbook for every day in the month

Sub test()
Dim monthnumber As Integer
Dim monthDays As Integer

monthnumber = 9

On Error Resume Next
MkDir "C:\" & Format(DateSerial(2006, monthnumber, 1), "mmm")
On Error GoTo 0

monthDays = DateSerial(2006, monthnumber + 1, 1) - DateSerial(2006, monthnumber, 1)

For I = 1 To monthDays
ThisWorkbook.SaveCopyAs "C:\" & Format(DateSerial(2006, monthnumber, 1), "mmm") & "\" & I & ".xls"
Next I
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sol" wrote in message oups.com...
So for every day in sep, it will save a file to the folder marked "Sep
2006", then in Oct it will create a new folder "Oct 2006" and save
there for the rest of the month.

Thanks for your help in advance



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to create a new folder according to the month Dolphin Excel Discussion (Misc queries) 5 December 15th 06 01:31 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Saving to a certain month folder Stephen Excel Programming 2 May 9th 06 05:44 PM
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM
"Save As" folder -- can I default this to the same folder as origi Mike Excel Discussion (Misc queries) 1 June 11th 05 12:06 AM


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"