Pinokkio
02-12-2010, 10:30 AM
Is there anyone who can explain this macro?
Sub test()
Make [A1].Value, [A2].Value
End Sub
Sub Make(pathTemplate As String, pathNew As String)
'No trailing "\" in path names assummed.
Dim fso As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(pathNew) Then fso.CreateFolder pathNew
fso.CopyFolder pathTemplate, pathNew, True 'True=Overwrite if files exist
fso.CopyFile ThisWorkbook (http://www.vbaexpress.com/forum/).FullName, pathNew & "\" & ThisWorkbook.Name
End Sub
It saves the file in folder in BB, that's all it does???
Cell A1 =C:\AA
Cell A2 =C:\BB
Thanks for the time spent in advance! :-)
Sub test()
Make [A1].Value, [A2].Value
End Sub
Sub Make(pathTemplate As String, pathNew As String)
'No trailing "\" in path names assummed.
Dim fso As Variant
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(pathNew) Then fso.CreateFolder pathNew
fso.CopyFolder pathTemplate, pathNew, True 'True=Overwrite if files exist
fso.CopyFile ThisWorkbook (http://www.vbaexpress.com/forum/).FullName, pathNew & "\" & ThisWorkbook.Name
End Sub
It saves the file in folder in BB, that's all it does???
Cell A1 =C:\AA
Cell A2 =C:\BB
Thanks for the time spent in advance! :-)