Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My spreadsheet makes multiple copies of a base sheet and then modifies the
new sheets in different ways. The macro works great the first time I open the file. If I try to run it again, it fails. The code is listed below: NumberOfCategories = Sheets("EditCategories").Cells(1, 4) - 1 '(D1-1) CategoryColumn = 5 TargetSheet = 13 LastColumn = CategoryColumn + NumberOfCategories Do Sheets(TargetSheet).Select 'THE CODE GENERALLY FAILS ON THE LINE BELOW WITH TargetSheet=14 Sheets(TargetSheet).Copy After:=Sheets(TargetSheet) DoEvents TargetSheet = TargetSheet + 1 Sheets(TargetSheet).Select NameOfSheet = Worksheets(TargetSheet).Cells(3, CategoryColumn) Sheets(TargetSheet).Name = NameOfSheet CategoryColumn = CategoryColumn + 1 Loop Until CategoryColumn = LastColumn Any help is appreciated, Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Sheets | Excel Worksheet Functions | |||
Copying Sheets | Excel Discussion (Misc queries) | |||
Problem with copying sheets | Excel Discussion (Misc queries) | |||
Excel 2000 problem copying drawingobjects between sheets | Excel Discussion (Misc queries) | |||
Problem copying range and pasting to multiple sheets | Excel Programming |