PC Review


Reply
Thread Tools Rate Thread

Create New Sheet from template sheet

 
 
=?Utf-8?B?RGF2aWQgQ295bGU=?=
Guest
Posts: n/a
 
      31st Oct 2006
Hi,

I am currently creating new sheet using the following code:

Private Sub cmdNewSheet_Click()
Sheets.Add Before:=Sheets("Finish"), Type:="C:\Documents and
Settings\Administrator\My Documents\Stock Control\StockTemplate1.xlt"
Sheets(Sheets.Count - 1).Name = txtNewSheet.Text
txtNewSheet.Text = ""
End Sub

What i would like to do is manipulate the code to create the sheet, but
instead of using the file 'Template1.xlt', i would like it to create them
from a worksheet called Temp.

Does anyone have any ideas? Is it even possible?

Thank you in anticipation.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      31st Oct 2006
Just copy the sheet.

worksheets("Temp").copy _
before:=worksheets(1)

And move it/rename it to what you want.

That Temp worksheet is in the same workbook, right?

David Coyle wrote:
>
> Hi,
>
> I am currently creating new sheet using the following code:
>
> Private Sub cmdNewSheet_Click()
> Sheets.Add Before:=Sheets("Finish"), Type:="C:\Documents and
> Settings\Administrator\My Documents\Stock Control\StockTemplate1.xlt"
> Sheets(Sheets.Count - 1).Name = txtNewSheet.Text
> txtNewSheet.Text = ""
> End Sub
>
> What i would like to do is manipulate the code to create the sheet, but
> instead of using the file 'Template1.xlt', i would like it to create them
> from a worksheet called Temp.
>
> Does anyone have any ideas? Is it even possible?
>
> Thank you in anticipation.


--

Dave Peterson
 
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
copying a template sheet and inputting a formula into another sheetthat references the new sheet A & S Microsoft Excel Programming 1 29th Jul 2009 08:59 PM
Create new sheets based off Data sheet, and template sheet Midget Microsoft Excel Programming 2 1st May 2007 09:55 PM
Create, name, open, and enter data in new sheet - from template =?Utf-8?B?QW5ufg==?= Microsoft Excel Misc 4 8th Jan 2007 11:59 PM
Writing data from one sheet to another template sheet and change the filename freeblue11@gmail.com Microsoft Excel Discussion 1 2nd Nov 2006 03:15 AM
Create a new sheet in a workbook from a template =?Utf-8?B?Um9nZXJOWg==?= Microsoft Excel Programming 1 16th Jun 2004 03:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 AM.