Johan90
05-07-2018, 06:24 AM
So as the title suggest I need help with renaming files. The Name As function I cant seem to get working for some reason
The macro will need to loop through two columns with old and new names, preferably I would like to have the old files deleted too.
I get the message box that all files have ben renamed succesfully.
This does nothing.
Sub RenameFiles()
Dim oldNa As String
Dim newNa As String
oldNa = Range("FO10")
newNa = Range("FP10")
Name oldNa As newNa
End Sub
So does this
Sub RenameFiles()
Name "C:\Users\xxxxxxx.AD\Desktop\Test\Vattenfall Invoice.txt" As "C:\Users\xxxxxx.AD\Desktop\Test\Vattenfall fakturorYYMM.txt"
End Sub
The macro will need to loop through two columns with old and new names, preferably I would like to have the old files deleted too.
I get the message box that all files have ben renamed succesfully.
This does nothing.
Sub RenameFiles()
Dim oldNa As String
Dim newNa As String
oldNa = Range("FO10")
newNa = Range("FP10")
Name oldNa As newNa
End Sub
So does this
Sub RenameFiles()
Name "C:\Users\xxxxxxx.AD\Desktop\Test\Vattenfall Invoice.txt" As "C:\Users\xxxxxx.AD\Desktop\Test\Vattenfall fakturorYYMM.txt"
End Sub