Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Sheets("sheet1").Copy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Little Penny - 17 Sep 2007 19:08 GMT
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.
Jim Thomlinson - 17 Sep 2007 19:40 GMT
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.
Signature

HTH...

Jim Thomlinson

> Sheets("sheet1").Copy
>
[quoted text clipped - 3 lines]
>
> I want to avoid changing everyone default template.
Jim Thomlinson - 17 Sep 2007 20:25 GMT
Are you thinking of Word where there is a Normal.dot file. XL has nothing
similar...
Signature

HTH...

Jim Thomlinson

> 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.
[quoted text clipped - 6 lines]
> >
> > I want to avoid changing everyone default template.
Dave Peterson - 17 Sep 2007 19:45 GMT
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).

> Sheets("sheet1").Copy
>
[quoted text clipped - 3 lines]
>
> I want to avoid changing everyone default template.

Signature

Dave Peterson

Little Penny - 18 Sep 2007 01:42 GMT
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

>I don't understand.
>
[quoted text clipped - 8 lines]
>>
>> I want to avoid changing everyone default template.
Dave Peterson - 18 Sep 2007 01:51 GMT
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\yourtemplatename.xlt")
   
   WksToCopy.Copy _
       before:=NewWkbk.Worksheets(1)

> I ceated a excel tempalte the include serveral macro.
>
[quoted text clipped - 16 lines]
> >>
> >> I want to avoid changing everyone default template.

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.