VBA FileCopy function

FileCopy function Description

The VBA FileCopy function copies a file from the source directory to the destination directory.

Syntax

The syntax for the ChDir function is:

FileCopy( source, destination )

Parameters

source
The source file path of the file you want to copy.

destination
The destination file path to which you want to copy the file to.

Example usage

The FileCopy statement can be used in VBA. Let’s look at some FileCopy function examples:

FileCopy "C:\Source\test.txt", "C:\Destination\test.txt"
'Result: Copies file from "C:\Source" to "C:\Destination"