Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy sheet1 and name sheets using names from a range
I want to modify this macro so that it copies sheet1, the appropriate number
of times. At present it adds new blank sheets. Sub CopySheet1() Dim arr As Variant arr = Range("i1:i44").Value For i = LBound(arr) To UBound(arr) Set NewSheet = Sheets.addd NewSheet.Name = arr(i, 1) Next i End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy sheet1 and name sheets using names from a range
Hi,
Sub CopySheet1() Dim arr As Variant Dim newsheet As Worksheet arr = Range("i1:i44").Value For i = LBound(arr) To UBound(arr) Worksheets("Sheet1").Copy after:=Worksheets("Sheet1") Set newsheet = ActiveSheet NewSheet.Name = arr(i, 1) Next i End Sub Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- I want to modify this macro so that it copies sheet1, the appropriate number of times. At present it adds new blank sheets. Sub CopySheet1() Dim arr As Variant arr = Range("i1:i44").Value For i = LBound(arr) To UBound(arr) Set NewSheet = Sheets.addd NewSheet.Name = arr(i, 1) Next i End Sub . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy sheet1 and name sheets using names from a range
Hi Jan,
Thank you for your help. That works wonderfully well. -- Regards, David Lindstrom "Jan Karel Pieterse" wrote in message ... Hi, Sub CopySheet1() Dim arr As Variant Dim newsheet As Worksheet arr = Range("i1:i44").Value For i = LBound(arr) To UBound(arr) Worksheets("Sheet1").Copy after:=Worksheets("Sheet1") Set newsheet = ActiveSheet NewSheet.Name = arr(i, 1) Next i End Sub Regards, Jan Karel Pieterse Excel TA/MVP -----Original Message----- I want to modify this macro so that it copies sheet1, the appropriate number of times. At present it adds new blank sheets. Sub CopySheet1() Dim arr As Variant arr = Range("i1:i44").Value For i = LBound(arr) To UBound(arr) Set NewSheet = Sheets.addd NewSheet.Name = arr(i, 1) Next i End Sub . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data in sheet1 to be put into sheets 2, 3, 4, 5, etc | Excel Discussion (Misc queries) | |||
VBA Code Required for deleting All Sheets except Sheet1 | Excel Discussion (Misc queries) | |||
Match Names in columns then copy associated info from 2 sheets | Excel Worksheet Functions | |||
Sheets named from range, and copy data? | Excel Discussion (Misc queries) | |||
How do I set up a workbook so changing Sheet1 changes all sheets? | Excel Worksheet Functions |