Link to home
Start Free TrialLog in
Avatar of davidam
davidamFlag for Canada

asked on

Rename folder with VBA

I have a folder as follows C:\NewFolder  This is found in Cell A2.
Cell A5 has the path to this folder C:\
I am trying to rename folder 'NewFolder' to 'FolderX'
My code is attached.   I get a File not Found error.
Please tell me what I am doing wrong.  Thanks!

Name (Range("A2").Value As Range("A5").Value & "FolderX"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PS I'm assuming that parenthesis between Name and Range is a typo and isn't actually in your code, since it wouldn't compile otherwise.
Avatar of davidam

ASKER

Yes, it was just sloppiness on my part.  The code works fine if it is done properly.