Hello. I use a spreadsheet for renaming a load of files at once.
My code goes through all cells from J5 to J500, this is the current file name. The new file name is in column K
Sub RenameAllFiles()
For Each cCell In Range("J5:J500")
If cCell.Value <> "" Then
Name cCell.Value As cCell.Offset(0, 1)
End If
Next
End Sub
The problem I'm having is when I encounter an error. For example I sometimes get Error 58: File already exists.
How do I change my code so if I encounter an error, skip the renaming, and move onto the next cell and continue
Bookmarks