Auto Generate a copy of a Template Worksheet and rename each
Closed
ChukieD
Posts
2
Registration date
Friday August 12, 2016
Status
Member
Last seen
August 13, 2016
-
Aug 12, 2016 at 07:32 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 15, 2016 at 02:55 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 15, 2016 at 02:55 AM
Related:
- Auto Generate a copy of a Template Worksheet and rename each
- Rename computer cmd - Guide
- Grand theft auto v free download no verification for pc - Download - Action and adventure
- Rename lg tv - Guide
- Stop facebook auto refresh - Guide
- Grand theft auto iv download apk for pc - Download - Action and adventure
2 responses
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 15, 2016 at 02:55 AM
Aug 15, 2016 at 02:55 AM
Hello ChukieD,
I'm not overly sure how you have set up your work book but below is a code that may, at least, set you in the right direction:-
Following is the link to my test work book:-
https://www.dropbox.com/s/vkwf8tr0amfqjm2/ChukieD%28create%20sheets%20from%20template%29.xlsm?dl=0
You'll see in the sample that there is a Summary sheet with the names and a set of columns where data can be placed.
You will also see a Template sheet. This is what the code uses to create a sheet for each and every name that is entered into the Summary sheet meaning that each sheet will be set out the same.
In your second post, you stated that the names in Column A will exceed the 31 character limit for sheet tabs, so, in the Summary sheet, I have created an ID column (Column B). Hence each name will have a shortened ID with which each sheet will be named. Cell A1 in each created sheet will have the full name in it (from Column A). You can experiment with the names and IDs to suit yourself in the test work book.
Click on the "RUN" button to see it work.
A template sheet may not be necessary in your case as individual sheets can be created from the Summary sheet instead, assuming that you would like all sheets to be set out the same as the Summary sheet. Let us know your thoughts.
I hope that this helps.
Cheerio,
vcoolio.
I'm not overly sure how you have set up your work book but below is a code that may, at least, set you in the right direction:-
Option Explicit Sub CreateSheets() Dim wsSumm As Worksheet, wsTmp As Worksheet Dim shtNames As Range, N As Range With ThisWorkbook Set wsTmp = .Sheets("Template") Set wsSumm = .Sheets("Summary") Set shtNames = wsSumm.Range("B2:B" & Rows.Count).SpecialCells(xlConstants) Application.ScreenUpdating = False For Each N In shtNames If Not Evaluate("ISREF('" & CStr(N.Text) & "'!A1)") Then wsTmp.Copy After:=.Sheets(.Sheets.Count) ActiveSheet.Name = CStr(N.Text) ActiveSheet.Range("A1").Value = N.Offset(, -1).Value End If Next N wsSumm.Select End With Application.ScreenUpdating = True End Sub
Following is the link to my test work book:-
https://www.dropbox.com/s/vkwf8tr0amfqjm2/ChukieD%28create%20sheets%20from%20template%29.xlsm?dl=0
You'll see in the sample that there is a Summary sheet with the names and a set of columns where data can be placed.
You will also see a Template sheet. This is what the code uses to create a sheet for each and every name that is entered into the Summary sheet meaning that each sheet will be set out the same.
In your second post, you stated that the names in Column A will exceed the 31 character limit for sheet tabs, so, in the Summary sheet, I have created an ID column (Column B). Hence each name will have a shortened ID with which each sheet will be named. Cell A1 in each created sheet will have the full name in it (from Column A). You can experiment with the names and IDs to suit yourself in the test work book.
Click on the "RUN" button to see it work.
A template sheet may not be necessary in your case as individual sheets can be created from the Summary sheet instead, assuming that you would like all sheets to be set out the same as the Summary sheet. Let us know your thoughts.
I hope that this helps.
Cheerio,
vcoolio.
ChukieD
Posts
2
Registration date
Friday August 12, 2016
Status
Member
Last seen
August 13, 2016
Aug 13, 2016 at 10:48 AM
Aug 13, 2016 at 10:48 AM
Just realized that there is a 31 character limitation in the amount of characters that can be used for the worksheet name. So need to specify that A1 must contain the full name and the tab for the worksheet could contain a part of name in A1.
Thanks
Thanks