Copying active sheet in a macro

D

David P.

I want to have a macro button that copies the active
sheet. When trying to do that by recording it references
the sheet that I recorded the macro under so that if I
were to ever copy and rename a sheet that macro button
references the original sheet that the macro was created
under. Any way to have a macro copy the active sheet
(regardless of it's name)? Thank you.
 
P

Paul B

David, where the macro recorder put the sheet name use this instead
ActiveSheet
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
D

Dave Peterson

This is one way:

ActiveSheet.Copy after:=ActiveSheet
'now the copied sheet is active
activesheet.name = "Nice Unique Name"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top