A macro to create new, copy and name worksheets based on a list
Solved/Closed
chottabeem
Posts
5
Registration date
Tuesday 19 July 2016
Status
Member
Last seen
22 July 2016
-
19 Jul 2016 à 02:24
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Moderator Last seen 6 September 2024 - 11 May 2017 à 00:52
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Moderator Last seen 6 September 2024 - 11 May 2017 à 00:52
Related:
- Excel vba copy sheet and rename based on cell value
- Rename sheet1 dec 16 - Best answers
- Excel vba copy worksheet to another workbook and rename - Best answers
- Based on the cell values in cells b77 ✓ - Excel Forum
- How to copy data from one excel sheet to another - Guide
- Rename lg tv - Guide
- Clear cell contents based on value of another cell range using VBA ✓ - Excel Forum
- Copying data from one Excel sheet to another. ✓ - Excel Forum
11 responses
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Moderator
Last seen
6 September 2024
262
21 Jul 2016 à 01:17
21 Jul 2016 à 01:17
Hello Chottabeem,
Assuming that you only want to create and name new sheets from the list in the Summary sheet, then the following code will do that:-
If you intend to use just numbers as the sheet names, then you will need to format those numbers as text otherwise, each time that you run the code, you will have additional and unwanted sheets added that will just have sheet numbers as names.
Run the code from the Summary sheet.
I hope that this helps.
Cheerio,
vcoolio.
Assuming that you only want to create and name new sheets from the list in the Summary sheet, then the following code will do that:-
Sub CreateNameNewSheets()
Dim LR As Long
Dim c As Range
Dim ws As Worksheet
LR = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("A2:A" & LR)
Set ws = Nothing
On Error Resume Next
Set ws = Worksheets(c.Value)
If ws Is Nothing Then
Worksheets.Add(After:=Sheets(Sheets.Count)).Name = c.Value
End If
Next c
End Sub
If you intend to use just numbers as the sheet names, then you will need to format those numbers as text otherwise, each time that you run the code, you will have additional and unwanted sheets added that will just have sheet numbers as names.
Run the code from the Summary sheet.
I hope that this helps.
Cheerio,
vcoolio.

21 Jul 2016 à 03:06
Thanks for immediate reply. The code works good and creates new worksheets listed in "Summary".
Please refer to my file (shared as link http://speedy.sh/xcHkc/Macro-Temp.xlsm ) there are two sheets"Summary" consists of list and "Sheet1" having data.
The existing "Sheet1" (with data) to be renamed and copied along with data for the list in "Summary" (like, 10, 20, 30, 40.... 200)
Hope I clarified and expect the right solution.