Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with 2 sheets: Summary and Template. On the Summary
sheet is a list of people in a range called emplist. the macro below copies the tempate worksheet and renames it to each of the employees listed in emplist. The problem is that is always fails after adding the 45th sheet. Here is the VBA, can anyone suggest a better way? Thanks in advance. Sub copysheet() Dim cell As Range, Rng As Range Set here = ThisWorkbook.ActiveSheet shtname = ActiveSheet.Name With Worksheets("Summary") Set Rng = .Range(.Range("emplist"), .Range("emplist").End(xlDown)) End With For Each cell In Rng If cell = "TM" Then ElseIf cell = "Template" Then Else Sheets("Template").Copy AFTER:=Sheets(Sheets.Count) ActiveSheet.Name = cell.Value End If Next Worksheets(shtname).Select here.Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy method of worksheet class failed | Excel Programming | |||
copy method of worksheet class failed | Excel Programming | |||
Copy Method of WorkSheet Class Failed! | Excel Programming | |||
Copy Method of Worksheet Class Failed | Excel Programming | |||
Copy Method of Worksheet Class Failed | Excel Programming |