ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   I want to create and name 365 worksheets... (https://www.excelbanter.com/excel-worksheet-functions/59404-i-want-create-name-365-worksheets.html)

Dr. Darrell

I want to create and name 365 worksheets...
 
I want to create 365 worksheets and name them for each day of 2006. I would
like to avoid typing each tab.

Can someone explain the method to do this?

Darrell

Ron de Bruin

I want to create and name 365 worksheets...
 
Hi Darrell

Try this

Sub test()
Dim I As Integer
For I = 1 To 365
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = Format(DateSerial(2006, 1, I), "yyyy-mmm-dd")
Next
End Sub


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


"Dr. Darrell" wrote in message ...
I want to create 365 worksheets and name them for each day of 2006. I would
like to avoid typing each tab.

Can someone explain the method to do this?

Darrell





All times are GMT +1. The time now is 08:39 PM.

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