ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically Insert Sheet (https://www.excelbanter.com/excel-programming/297627-automatically-insert-sheet.html)

peter

Automatically Insert Sheet
 
Is there a way to have excel automatically add a worksheet
to an excel file upon opening? All files i will be
opening will have only one worksheet. Any direction anyone
could give me would be terrific. thanks, peter

Ron de Bruin

Automatically Insert Sheet
 
Hi Peter

Try this event in the Thisworkbook module

Private Sub Workbook_Open()
Worksheets.Add.Name = Format(Now, "dd-mm-yy h-mm-ss")
End Sub

It will give the sheet a name(Date/Time)

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


"Peter" wrote in message ...
Is there a way to have excel automatically add a worksheet
to an excel file upon opening? All files i will be
opening will have only one worksheet. Any direction anyone
could give me would be terrific. thanks, peter




peter

Automatically Insert Sheet
 
Ron, your advice worked perfectly. thankyou and have a
great weekend. peter



-----Original Message-----
Hi Peter

Try this event in the Thisworkbook module

Private Sub Workbook_Open()
Worksheets.Add.Name = Format(Now, "dd-mm-yy h-mm-ss")
End Sub

It will give the sheet a name(Date/Time)

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


"Peter" wrote in

message ...
Is there a way to have excel automatically add a

worksheet
to an excel file upon opening? All files i will be
opening will have only one worksheet. Any direction

anyone
could give me would be terrific. thanks, peter



.



All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com