Creating Sheet Tabs from a list

G

Guest

How do I take a list from a sheet tab (say 100 items in Column A of the tab)
and make a sheet tab for every item in the list?
 
J

JE McGimpsey

One way:

Public Sub MakeTabsFromList()
Dim i As Long
Dim nCount As Long
nCount = Worksheets.Count
With ActiveSheet
With .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
Worksheets.Add _
After:=Worksheets(nCount), _
Count:=.Rows.Count
On Error Resume Next
For i = 1 To .Rows.Count
Worksheets(i + nCount).Name = .Cells(i).Text
Next i
On Error GoTo 0
End With
End With
End Sub
 
B

Bernard Liengme

This worked for me - change A1:A4 to whatever suits your need

Sub makebook()
myrange = Range("A1:A4")
For Each mycell In myrange
Worksheets.Add After:=Sheets(Sheets.Count)
myname = Format(mycell, "xxxxxxxxxx")
' if the entries are numbers use: myname = Format(mycell, "0000")
Worksheets(Sheets.Count).Name = myname
Next
End Sub

best wishes
 
B

Bernard Liengme

By the way: you are inserting WORKSHEETS. "Tabs" are just the do-hickie
things (that's a technical term <gr>) that you click to open a sheet
(worksheet or chartsheet)
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top