PC Review


Reply
Thread Tools Rate Thread

copying an existing sheet

 
 
thomas donino
Guest
Posts: n/a
 
      26th Aug 2009
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?
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      26th Aug 2009
'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
---------------
Jacob Skaria


"thomas donino" wrote:

> 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?

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      26th Aug 2009
have you tried


sheets("Template").copy
activesheet.name="newnamehere"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"thomas donino" <(E-Mail Removed)> wrote in message
news:158B13C5-78D3-4CF9-832B-(E-Mail Removed)...
>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?


 
Reply With Quote
 
thomas donino
Guest
Posts: n/a
 
      26th Aug 2009
thank you

"Jacob Skaria" wrote:

> '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
> ---------------
> Jacob Skaria
>
>
> "thomas donino" wrote:
>
> > 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?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename sheet with (2) after existing name of existing sheet al Microsoft Excel Programming 3 13th Jan 2010 06:49 PM
Creating a new sheet from specific data in existing sheet Rosscoe Microsoft Excel Misc 3 13th Jan 2010 06:08 PM
Copy rows onto existing sheet / start a new sheet if full mg_sv_r Microsoft Excel Programming 0 29th Nov 2007 12:57 PM
copying specific rows to an existing sheet, based on user paramete =?Utf-8?B?Q2FybGVl?= Microsoft Excel Programming 1 2nd Apr 2007 12:38 PM
Copy the entire sheet to overlay existing sheet? LurfysMa Microsoft Excel New Users 2 29th Aug 2005 07:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:22 AM.