Am I able to have 20 sheets in excel?
Thank you.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dgui...@gmail.com
"LC" <L...@discussions.microsoft.com> wrote in message
news:1F817D02-42E1-49D4...@microsoft.com...
Sub CreateNameSheets()
' by Dave Peterson
' List your 20 names 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 = mycell.Value
If Err.Number <> 0 Then
MsgBox "Please fix: " & ActiveSheet.Name
Err.Clear
End If
On Error GoTo 0
Next mycell
End Sub
Gord Dibben MS Excel MVP