How name a copied worksheet?

  • Thread starter Thread starter David
  • Start date Start date
D

David

I was given this code to copy a worksheet to another:
Activesheet.copy After:=ActiveSheet

How do I give the new worksheet a name rather than it
using the same name with a number in parentheses after it?

- David
 
David,

The new sheet is the active sheet after a Copy operation, so you
can use ActiveSheet. E.g.,

ActiveSheet.Name = "NewName"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Hi David

Name it "Harald". Great norwegian name, done like this:

Sub test()
On Error Resume Next
ActiveSheet.Copy After:=ActiveSheet
ActiveSheet.Name = "Harald"
End Sub

-yes, it's a separate operation. I think it has to be that way.
 
Back
Top