

December 4, 2021

I have a sheet that contains 3 cell values (screenshot below), which I want to be used to rename the files. This macro I found initially had only 2 values, and the path was included on both of these cell values. I want the path to be listed in a separate line, it will, of course be the same for both.
Cell C2 - Path (for BOTH files)
Cell C4 - Existing Filename
Cell C6 - Rename to
Name ActiveSheet.Range("C4") As _
ActiveSheet.Range("C6")
End Sub


October 17, 2018

Sub VBARenameFileSheetNames()
'* Sytax is: FileCopy sourceFullName, newFileName
FileCopy ActiveSheet.Range("C2") & ActiveSheet.Range("C4") , ActiveSheet.Range("C2") & ActiveSheet.Range("C6")
Kill FileCopy ActiveSheet.Range("C2") & ActiveSheet.Range("C4")
End Sub
Make sure that the file path contains the final backslash
You will have to add check if target file is not already present and if the sourcefile is present
1 Guest(s)
