Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to create a new folder according to the month | Excel Discussion (Misc queries) | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
Saving to a certain month folder | Excel Programming | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) | |||
"Save As" folder -- can I default this to the same folder as origi | Excel Discussion (Misc queries) |