Adding (creating) worksheet

  • Thread starter Thread starter Martin Racette
  • Start date Start date
M

Martin Racette

Hi,

I have create a .XLS file that control some data on a daily basis, what I would
like to do now is to create a new worksheet with everything that is already
existing (calculation, lookuptable, etc....) for each new day.

Since most of the users of the program don't know much else than how to input
the data, I would like to automate the creation of a new sheet everytime that
the this .XLS is open

I have looked around and I can't find how to do this

Any help would be appreciated

--
Thank you in Advance

Merci a l'Avance

Martin
 
Hi Martin,

Private Sub Workbook_Open()
With ThisWorkbook.Worksheets
.Add after:=.Item(.Count)
End With
End Sub


This code goes intoi the ThisWorkbook code module.
 
Martin

Copy the worksheet to a new workbook as you want it set up for inserting.

Save As Template(*.xlt)

Name it SHEET and store it in your XLSTART folder.

In your original workbook right-click on the Excel logo left of "File" on the
menu bar.

Select "View Code"

Copy/paste this code in there.

Private Sub Workbook_Open()
Sheets.Add Type:="Worksheet"
ActiveSheet.Name = "newsheet" 'your choice of name'
End Sub

ALT + Q to return to Excel Window. Save and close your workbook.

Gord Dibben Excel MVP
 
I did the code that you sent me, but what I would like is
1) for to confirm whether I want to add a new sheet
2) to make an exact copy of the original sheet, so that all the computation and
lookup table, etc...

--
Thank you in Advance

Merci a l'Avance

Martin
 
Martin

Do you really want a "exact" copy of the sheet including the data inputted by
the users?

I would think you would want just the formulas and perhaps Titles without the
"constants" data so's you would have a new sheet for new input each day.

Post back with which scenario you want.

Gord Dibben Excel MVP
 
I would prefer a new sheet ready for input every day with all the formulas
lookup table etc... , except for the data

--
Thank you in Advance

Merci a l'Avance

Martin
 
Back
Top