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

Closed
Tam - 18 May 2015 à 13:08
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Contributor Last seen 6 September 2024 - 19 May 2015 à 07:11
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 24 July 2014 Status Contributor Last seen 6 September 2024 262
19 May 2015 à 07:11
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.