Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Sheets("sheet1").Copy

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Sheets("sheet1").Copy

What do you mean by default template??? That line of code copies the sheet
with tab name "sheet1" from the active workbook to a new workbook.
--
HTH...

Jim Thomlinson


"Little Penny" wrote:

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sheets("sheet1").Copy

I don't understand.

This'll copy that sheet1 to a new workbook--there's no template involved (no
workbook template and no worksheet template).



Little Penny wrote:

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Sheets("sheet1").Copy

Are you thinking of Word where there is a Normal.dot file. XL has nothing
similar...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

What do you mean by default template??? That line of code copies the sheet
with tab name "sheet1" from the active workbook to a new workbook.
--
HTH...

Jim Thomlinson


"Little Penny" wrote:

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Sheets("sheet1").Copy

I ceated a excel tempalte the include serveral macro.

I want to be able use

Sheets("sheet1").Copy

But have excel use the template to open the new workbook



On Mon, 17 Sep 2007 13:45:50 -0500, Dave Peterson
wrote:

I don't understand.

This'll copy that sheet1 to a new workbook--there's no template involved (no
workbook template and no worksheet template).



Little Penny wrote:

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sheets("sheet1").Copy

Create a new workbook that uses that template.
Copy the worksheet into that workbook.

Dim NewWkbk As Workbook
Dim WksToCopy As Worksheet

Set WksToCopy = ActiveWorkbook.Worksheets("Sheet1")

Set NewWkbk = Workbooks.Add(template:="C:\folder\yourtemplatenam e.xlt")

WksToCopy.Copy _
befo=NewWkbk.Worksheets(1)



Little Penny wrote:

I ceated a excel tempalte the include serveral macro.

I want to be able use

Sheets("sheet1").Copy

But have excel use the template to open the new workbook

On Mon, 17 Sep 2007 13:45:50 -0500, Dave Peterson
wrote:

I don't understand.

This'll copy that sheet1 to a new workbook--there's no template involved (no
workbook template and no worksheet template).



Little Penny wrote:

Sheets("sheet1").Copy

This line of code copies the sheet1 to a new workbook useing the
default template. Is there a way to put into the code and tell excel
which template to use.

I want to avoid changing everyone default template.


--

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
Sheets("Sheet1").Cells.ClearContents Seeker Excel Discussion (Misc queries) 2 October 1st 09 12:00 PM
Sheets("Sheet1").Move After:=Sheets(2) Arturo Excel Programming 2 January 19th 06 07:33 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Sheets("sheet1").Range command between workbooks Luc[_3_] Excel Programming 3 September 27th 05 01:03 PM
Sheet1 object not Worksheets("Sheet1") onedaywhen Excel Programming 2 August 12th 03 12:38 PM


All times are GMT +1. The time now is 03:42 PM.

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

About Us

"It's about Microsoft Excel"