ExcelDennis
New Member
- Joined
- Aug 12, 2013
- Messages
- 25
Hi,
I want to rename PT63MW-2012 Ocena Roczna dla Joanna Oręczuk-18159.pdf to 2570657_Perf_doc_2012_Succesfactor_1335.pdf
PT63MW-2012 Ocena Roczna dla Joanna Oręczuk-18159.pdf is in cell A1
2570657_Perf_doc_2012_Succesfactor_1335.pdf is in cell B1
File is in C\temp\
I use following VBA script
Sub rename_()
Dim OldName As String, NewName As String, mydir As String
mydir = "C:\Temp"
With Worksheets("Sheet1")
OldName = .Range("A1").Value
NewName = .Range("B1").Value
End With
Name mydir & OldName As mydir & NewName
End Sub
After running i do get Run-time error '53': File not Found. I guess because of the special Character ę in the name.
Pls help me with changing the code so i can rename the file. (need to rename over 15000 files with special characters)
Thanks
I want to rename PT63MW-2012 Ocena Roczna dla Joanna Oręczuk-18159.pdf to 2570657_Perf_doc_2012_Succesfactor_1335.pdf
PT63MW-2012 Ocena Roczna dla Joanna Oręczuk-18159.pdf is in cell A1
2570657_Perf_doc_2012_Succesfactor_1335.pdf is in cell B1
File is in C\temp\
I use following VBA script
Sub rename_()
Dim OldName As String, NewName As String, mydir As String
mydir = "C:\Temp"
With Worksheets("Sheet1")
OldName = .Range("A1").Value
NewName = .Range("B1").Value
End With
Name mydir & OldName As mydir & NewName
End Sub
After running i do get Run-time error '53': File not Found. I guess because of the special Character ę in the name.
Pls help me with changing the code so i can rename the file. (need to rename over 15000 files with special characters)
Thanks