View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default programatically creating worksheets

Janet

You don't have to have the Template sheet in the workbook at all.

Open a new workbook and delete all but one sheet.

Format that sheet as you wish then Save AsFile TypeMS Excel Template.

Name it SHEET and store it in your XLSTART folder.

To use it when creating new sheets use code similar to this.

Sub Add_Sheets11()
Sheets.Add(Type:="Worksheet").Name = "Newsheet"
End Sub

Or just click on InsertWorksheet which uses your SHEET.xlt as a new sheet.


Gord Dibben MS Excel MVP

On Tue, 20 Feb 2007 15:18:12 -0800, Janet Panighetti
wrote:

Don't you need to "unhide" the sheet in order to copy it? If not, then my
question is answered. :)

I just don't want my users to ever see that it is there.... even as a
passing glance.

Thanks

"Jim Thomlinson" wrote:

You can create sheets right from nothing but it is a horrendous amount of
work. What is your aversion to using a hidden sheet as a template to create
the new sheets. It is easy and the template sheets can be completely hidden
from the end users such that they never even know that they are there...
--
HTH...

Jim Thomlinson

"Janet Panighetti" wrote:

I would like my workbook to prompt the user for the "type" of a "form" to add
to the workbook, and then run a funtion which creates that type of a
worksheet.

In thinking about this, I have a question......

Is it possible to retrieve the structure of a worksheet (cell formats,
values, borders, patterns, protection, etc.) from an existing worksheet? If
so, I would like to store that information in a function to run on demand.

I do not want to have these forms hidden in the workbook.

Did I make this question clear or would you like me to be more specific?

Thank you in advance!! :)

Janet