Try running the sub below (Sub is by Dave Peterson, and was plucked from a
post by Gord Dibben in .newusers)
Here's how to set it up ..
In a new book,
Name 2 empty sheets as: List, Template
In List, enter in A1 the first date, say: 26-Dec-2005
Copy A1 down to say, A10, to fill the range till 04-Jan-2006
In Template, we could prepare a sample "template" table with col headers,
sample data, format to taste, etc (or just leave the sheet blank for now)
The sub will copy the sheet named as: Template
and create & name the new sheets
according to the list in col A in List
Steps
--------
Press Alt+F11 to go to VBE
Click Insert > Module
Copy > paste everything within the dotted lines below
into the code window (whitespace) on the right
'-------begin vba-----
Sub CreateNameSheets()
' by Dave Peterson
' (slightly revised by Max to format sheetnames <g>)
' List sheetnames required in col A in a sheet: List
' Sub will copy sheets based on the sheet named as: Template
' and name the sheets accordingly
Dim TemplateWks As Worksheet
Dim ListWks As Worksheet
Dim ListRng As Range
Dim myCell As Range
Set TemplateWks = Worksheets("Template")
Set ListWks = Worksheets("list")
With ListWks
Set ListRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With
For Each myCell In ListRng.Cells
TemplateWks.Copy After:=Worksheets(Worksheets.Count)
On Error Resume Next
ActiveSheet.Name = Format(myCell.Value, "dddd, mmmm dd, yyyy")
If Err.Number <> 0 Then
MsgBox "Please fix: " & ActiveSheet.Name
Err.Clear
End If
On Error GoTo 0
Next myCell
End Sub
'-------endvba------
Press Alt+Q to get back to Excel
In Excel, press Alt+F8 (brings up the Macro dialog)
Select "CreateNameSheets" > click "Run"
(or just double-click directly on "CreateNameSheets")
The sub will create 10 new sheets to the right,
naming these as desired:
Monday, December 26, 2005
Tuesday, December 27, 2005
....
Wednesday, January 04, 2006