Copying folders using VB in Excel

  Desert Andy 14:54 27 Nov 2004
Locked

I am trying to write code to copy folders to a back up folder, whilst in Excel, to back up my files once a week. Is there any way I can do this.
Thanks - Andy

  pc moron 18:59 27 Nov 2004

This procedure will copy all the workbooks in Source to Destination.

Sub BackUpFiles()


Dim fs As Variant


Set fs=CreateObject("Scripting.FileSystemObject")


fs.copyfile "c:\Source\*.xls", "c:\Destination"


End Sub


This procedure will copy all the folders in Source to Destination.


Sub BackUpFolders()


Dim fs As Variant


Set fs=CreateObject("Scripting.FileSystemObject")


fs.copyfolder "c:\Source\*", "c:\BackUpFolder"


End Sub

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

See the work of famous artists playing with toys

iPad Pro 10.5in (2017) review

Comment faire une capture d’écran sur un Mac ?