Solved One excel file to multiple folders

January 9, 2014 at 03:23:57
Specs: Windows 7
I have one excel file which is basically a template, I want to be able to copy/save it to multiple folders at once?

is there a runscript or something I can use?

The file in question is called "licence" the folder names would be 001 002 003 etc etc

Any ideas greatly appreciated.


See More: One excel file to multiple folders

Report •

#1
January 9, 2014 at 13:34:39
✔ Best Answer
If you are really saving the files to folders that are named in a numerical sequence, then you could record a macro as you Save As the file to "001" folder and then loop the instruction to Save to each folder in sequence:

Recorded Code:

Sub Macro2()
'
' Macro2 Macro
'

'
    ActiveWorkbook.SaveAs Filename:= _
        "C:\Users\my_name\my_folder_001\my_file.xlsb",  _
               FileFormat:=xlExcel12, CreateBackup:=False

End Sub

Modified Code:

Sub SaveTo001_009()

   For folderNum = 1 to 9
     ActiveWorkbook.SaveAs Filename:= _
        "C:\Users\my_name\my_folder_00" & folderNum &"\my_file.xlsb", _
               FileFormat:=xlExcel12, CreateBackup:=False
   Next

End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question