VBA Name Statement

The Excel VBA Name statement changes the name of file or directory to a new given name.

VBA Name Statement Syntax

The syntax for the VBA Name statement in VBA is:

Name oldName As new Name

Parameters

oldName
The current full path to the file or directory you want to rename.
newName
The new full path to the file or directory.

Example VBA Name Statement usage

Name "C:\OldFileName.txt" As "C:\NewFileName.txt"

Name "C:\OldFolderName\" As "C:\NewFolderName\"