Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JVZ JVZ is offline
external usenet poster
 
Posts: 1
Default Adding a new sheet based on a template

I need to add a new worksheet using the VBA ADD method. How can I specify
the worksheet template I want to base the worksheet on?

Thanks, and sorry for my english


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Adding a new sheet based on a template

Use this

Sheets.Add Type:=Application.TemplatesPath & "\xxxxx.xlt"


--
Regards Ron de Bruin
http://www.rondebruin.nl


"JVZ" wrote in message ...
I need to add a new worksheet using the VBA ADD method. How can I specify
the worksheet template I want to base the worksheet on?

Thanks, and sorry for my english




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding a new sheet based on a template

I am not sure you can do it with ADD, but

set wkbk = workbooks.open( filename:= _
"C:\MyTemplates\Workbook1.xls")
wkbk.Worksheets(1).copy After:=thisworkbook.Worksheets( _
thisworkbook.Worksheets.count)

wkbk.close Savechanges:=False

--
Regards,
Tom Ogilvy


"JVZ" wrote in message
...
I need to add a new worksheet using the VBA ADD method. How can I specify
the worksheet template I want to base the worksheet on?

Thanks, and sorry for my english




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
Adding a new template spread sheet on the first day of a new month Dobbin0_4[_2_] Excel Discussion (Misc queries) 1 January 23rd 09 11:53 PM
adding sheets based upon a template sheet [email protected] Excel Worksheet Functions 1 December 7th 07 05:03 PM
adding a sheet to database using the template Wizard rcj_84 Excel Discussion (Misc queries) 0 October 24th 06 09:14 PM
Adding a new Excel template Anonymous Excel Discussion (Misc queries) 1 September 26th 05 09:40 PM
balance sheet template in excel adding lines JMJM Excel Discussion (Misc queries) 1 December 1st 04 11:23 PM


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

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"