![]() |
How to copy worksheet template into multiple worksheets
I have a main worksheet I have been working on which I am now ready to roll
out to multiple worksheets. Using this VB I already created the sheets with the tab names I needed as the tab names are customer numbers Sub CreateSheetsFromAList() Dim myCell As Range, MyRange As Range Set MyRange = Sheets("RawData").Range("RawData!L:L") Set MyRange = Range(MyRange, MyRange.End(xlDown)) For Each myCell In MyRange Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet Sheets(Sheets.Count).Name = myCell.Value ' renames the new worksheet Next myCell End Sub Now I am trying to figure out how to incorporate the ability to copy the contents of the main sheet into those worksheets with the VB that creates the tabs. Because the data will change I need to be able to update the workbook with new customers and add the template for the same look and feel. any suggestions . Thanks Any suggestions -- Nelson |
How to copy worksheet template into multiple worksheets
Assuming the sheet you wanted to copy was named "template", why not just
replace your line: Sheets.Add After:=Sheets(Sheets.Count) with this instead? Sheets("template").Copy After:=Sheets(Sheets.Count) "Nelson" wrote: I have a main worksheet I have been working on which I am now ready to roll out to multiple worksheets. Using this VB I already created the sheets with the tab names I needed as the tab names are customer numbers Sub CreateSheetsFromAList() Dim myCell As Range, MyRange As Range Set MyRange = Sheets("RawData").Range("RawData!L:L") Set MyRange = Range(MyRange, MyRange.End(xlDown)) For Each myCell In MyRange Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet Sheets(Sheets.Count).Name = myCell.Value ' renames the new worksheet Next myCell End Sub Now I am trying to figure out how to incorporate the ability to copy the contents of the main sheet into those worksheets with the VB that creates the tabs. Because the data will change I need to be able to update the workbook with new customers and add the template for the same look and feel. any suggestions . Thanks Any suggestions -- Nelson |
All times are GMT +1. The time now is 05:41 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com