copying an existing sheet

T

thomas donino

I have a macro that creates reports from a main sheet. I want to make the new
sheets it creates come from a template, ie a sheet i call template in the
current workbook. This will eliminate multiple copy and paste steps in the
current macro.

I recorded a macro that right clicks the sheet tab, copies and renames but
that doesn't work when run.

any thoughts?
 
J

Jacob Skaria

'The below will copy the current sheet and rename
ActiveSheet.Copy After:=ActiveSheet
Set ws = ActiveSheet
ws.Name = "newname"

'The below will copy the current sheet to the end...and rename
ActiveSheet.Copy After:=Sheets(Sheets.Count)
Set ws = ActiveSheet
ws.Name = "newname"


If this post helps click Yes
 
T

thomas donino

thank you

Jacob Skaria said:
'The below will copy the current sheet and rename
ActiveSheet.Copy After:=ActiveSheet
Set ws = ActiveSheet
ws.Name = "newname"

'The below will copy the current sheet to the end...and rename
ActiveSheet.Copy After:=Sheets(Sheets.Count)
Set ws = ActiveSheet
ws.Name = "newname"


If this post helps click Yes
 

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