Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Create New Sheet from template sheet

Hi,

I am currently creating new sheet using the following code:

Private Sub cmdNewSheet_Click()
Sheets.Add Befo=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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Create New Sheet from template sheet

Just copy the sheet.

worksheets("Temp").copy _
befo=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 Befo=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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create Login & Log out Spread sheet in Excel with automated Attendance sheet marc5354 Excel Worksheet Functions 2 September 21st 10 04:22 PM
Making a macro on a template update with new each new sheet create Michelle D[_2_] Excel Discussion (Misc queries) 0 August 10th 09 04:53 PM
How to merge data in Excel - one sheet to template sheet? Gabriela Excel Worksheet Functions 2 July 26th 07 03:34 PM
Create, name, open, and enter data in new sheet - from template Ann~ Excel Discussion (Misc queries) 6 January 8th 07 11:59 PM
Create a new sheet in a workbook from a template RogerNZ Excel Programming 1 June 16th 04 03:23 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"