View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
SmilingPolitely[_3_] SmilingPolitely[_3_] is offline
external usenet poster
 
Posts: 14
Default Add Sheet - Copy Worksheet

ckrogers wrote:
I'd like to add four buttons to a worksheet. When any of the buttons are
clicked, a sheet will be added (to the end) of a workbook. Then, depending
on which button is clicked, one of four worksheet templates will be copied
onto the new sheet. The four templates could either be four separate files,
or they could be separate sheets in one file ... whichever works
better/easier....
Help, please!
Cindy



From Excel 2003 Help....

Insert a new sheet that's based on a custom template
You must have already created a custom sheet template.

How?

Decide which type of template you want:

Workbook template

Create a workbook that contains the sheets, default text (such as page
headers and column and row labels), formulas, macros (macro: An action
or a set of actions you can use to automate tasks. Macros are recorded
in the Visual Basic for Applications programming language.), styles
(style: A combination of formatting characteristics, such as font, font
size, and indentation, that you name and store as a set. When you apply
a style, all of the formatting instructions in that style are applied at
one time.), and other formatting you want in new workbooks based on the
template.

Worksheet template

Create a workbook that contains one worksheet. On the worksheet, include
the formatting, styles (style: A combination of formatting
characteristics, such as font, font size, and indentation, that you name
and store as a set. When you apply a style, all of the formatting
instructions in that style are applied at one time.), text, and other
information you want to appear on all new sheets of the same type.

To display a picture of the first page of a template in the Preview box
of the Templates dialog box (General Templates..., New Workbook task
pane), click Properties on the File menu, click the Summary tab, and
then select the Save preview picture check box.

On the File menu, click Save As.

In the Save as type box, click Template.

In the Save in box, select the folder where you want to store the template.

To create the default workbook template (default workbook template: The
Book.xlt template that you create to change the default format of new
workbooks. Excel uses the template to create a blank workbook when you
start Excel or create a new workbook without specifying a template.) or
default worksheet template (default worksheet template: The Sheet.xlt
template that you create to change the default format of new worksheets.
Excel uses the template to create a blank worksheet when you add a new
worksheet to a workbook.), select either the XLStart folder or the
alternate startup folder (alternate startup folder: A folder in addition
to the XLStart folder that contains workbooks or other files that you
want to be opened automatically when you start Excel and templates that
you want to be available when you create new workbooks.). The XLStart
folder is usually

C:\Program Files\Microsoft Office\Office11\XLStart

To create a custom workbook or worksheet template, select the Templates
folder, which is usually

C:\Documents and Settings\user_name\Application Data\Microsoft\Templates




Then just


Sheets.Add Type:="your user path\templateName.xlt"


Hope this helps.