VBA CopyFolder

The FileSystemObject VBA CopyFolder method copies one or more folders from one a source to a destination location.

VBA CopyFolder Syntax

fso.CopyFile source, destination, [ overwrite ]

The source location of the folders. You can use wildcards such as *.* to specify more than a single folder matching the pattern.
The destination location (folder) where the source folders are to be copied to.
Optional. If True will overwrite folders with same name in destination folder. If True it will omit folders for which there is an existing folder in the destination folder.

VBA CopyFolder Examples

Set fso = CreateObject("Scripting.FileSystemObject")

'Copy just the Hello folder
fso.CopyFolder "c:\Src\Hello", "c:\Dest\" 

'Copy all folders starting with "Names" title to destination folder
fso.CopyFolder "c:\Src\Names*", "c:\Dest\" 

'Copy all folders to destination folder
fso.CopyFolder "c:\Src\*", "c:\Dest\"