How do I populate worksheet tabs via a formula or macros?

Closed
Tam - May 18, 2015 at 01:08 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - May 19, 2015 at 07:11 AM
Hello,

I have a list of fifty different names I need to enter on the tabs of 50 worksheets (all on the same workbook). Is there a macros formula I can use to accomplish this? I'm trying to not manually enter 50 names on tabs/worksheets.

I know how to get the tab names to form a list on a separate sheet, how do I reverse that?

Thank you


Related:

1 response

vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 262
May 19, 2015 at 07:11 AM
Hello Tam,

You could try the following code:-

Sub NewSheetAndNames()

    Dim ws As Worksheet
    Dim x As Integer
    x = 1
    
Do While Sheets("Sheet1").Cells(x, 1).Value <> ""
Set ws = Sheets.Add
ws.Name = Sheets("Sheet1").Cells(x, 1).Value
x = x + 1
Loop

End Sub


Enter the code in a standard module. The code extracts the sheet names from a list in Column A, Sheet1.

Attached is my test work book for you to peruse:-

https://www.dropbox.com/s/ux5rpqzy59v5o9x/Create%20and%20Name%20New%20Sheets.xlsm?dl=0

I hope that this helps.

Cheerio,
vcoolio.
0