Thread
:
Creating N worksheets
View Single Post
#
2
Posted to microsoft.public.excel.programming
Mike Fogleman
external usenet poster
Posts: 1,092
Creating N worksheets
This will do that:
Sub CopyNsheets()
Dim i As Long
For i = 1 To Worksheets("Sheet1").Range("C2").Value
Sheets("Sheet2").Copy After:=Worksheets(Sheets.Count)
ActiveSheet.Name = Worksheets("Sheet1").Range("C2").Offset(i, 0).Value
Next
End Sub
Mike F
"Adrian Watts" <Adrian
wrote in message
...
I have a macro can copy a spreadsheet in a workbook. I start of with two
spreadsheets in the workbook. The second sheet is the one I copy. On the
first worksheet I have the number of times the second spreadsheet is to be
copied in a cell, say C2. Below I have the name of each of the worksheets.
What I want to do is to copy the second worksheet N times where N is the
number in the cell C2 of the first worksheet - ie. I want to
automatically
run my macro to copy a spreadsheet N times. I then want to run a macro for
renaming those worksheet according to names listed in the firsr worksheet.
How do I accomplish this?
Reply With Quote
Mike Fogleman
View Public Profile
Find all posts by Mike Fogleman