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

Report
-
Posts
1278
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
February 16, 2021
-
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


1 reply

Posts
1278
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
February 16, 2021
220
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.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!