Hi to everybody..
I'm renaming my pdf files in one folder from the excel sheet list which my PDF filename are drawing number only but I want to add in my pdf filename the drawing title which is in the excel sheet. So I made this vba code but now its not wor
What is the wrong in my vba code, i'm getting run time error 5. The vba code is look like this.
Sub ChangeInFolder()
Dim OldName As String
Dim NewName As String
Dim LastRow As Long
Dim i As Long
LastRow = Range("A65536").End(xlUp).Row
For i = 11 To LastRow
OldName = Range("A" & i).Value
NewName = Range("C" & i).Value
' OldName = "\\172.16.95.58\Finance-BackOffice\Bank Statement\Supporting\" + Range("A" & i).Value + ".pdf"
' NewName = "\\172.16.95.58\Finance-BackOffice\Bank Statement\Supporting\" + Range("C" & i).Value + ".pdf"
Name OldName As NewName
Next i
Range("C2", Range("C2").End(xlDown)).ClearContents
Application.ScreenUpdating = True
End Sub
I'm renaming my pdf files in one folder from the excel sheet list which my PDF filename are drawing number only but I want to add in my pdf filename the drawing title which is in the excel sheet. So I made this vba code but now its not wor
What is the wrong in my vba code, i'm getting run time error 5. The vba code is look like this.
Sub ChangeInFolder()
Dim OldName As String
Dim NewName As String
Dim LastRow As Long
Dim i As Long
LastRow = Range("A65536").End(xlUp).Row
For i = 11 To LastRow
OldName = Range("A" & i).Value
NewName = Range("C" & i).Value
' OldName = "\\172.16.95.58\Finance-BackOffice\Bank Statement\Supporting\" + Range("A" & i).Value + ".pdf"
' NewName = "\\172.16.95.58\Finance-BackOffice\Bank Statement\Supporting\" + Range("C" & i).Value + ".pdf"
Name OldName As NewName
Next i
Range("C2", Range("C2").End(xlDown)).ClearContents
Application.ScreenUpdating = True
End Sub