Hi, all
I wonder if you can assist me in this issue.
I have some code and it works fine for copying a worksheet and renaming it. BUT - if I cancel, it generates a Runtime 1004 error. Is there anything that has been missed in this code?
I'd be profoundly grateful if anyone can assist me here.
Here is the code:
Sub CopySheet_rename()
'assumming your active sheet is the one you want to copy
currentName = ActiveSheet.Name
CopyName = InputBox("Enter name of new Contractor: ")
Sheets(currentName).Copy After:=Sheets(currentName)
ActiveSheet.Name = CopyName
End Sub
Kind regards in advance,
Jaime.
Bookmarks