VBA: Create sheets from list [Closed]

Report
Posts
1
Registration date
Friday July 20, 2018
Status
Member
Last seen
July 20, 2018
-
Posts
2658
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 28, 2020
-
Hello,
suppose i have value in column A from 1 to 10 then i want to create a sheet from 1 to 10 using macro



2 replies


So record a macro of it and do it!

Highlight the row, cut it, select the tab, new tab, rename it "1", highlight the first row, paste the row!

It is that simple!

Have FUN!
Posts
2658
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 28, 2020
440
Since the macro recorder doesn't show you how to loop, give this code a try:
Sub RunMe()
For Each cell In Range("A1:A10")
    Sheets.Add
    ActiveSheet.Name = cell.Value
Next cell
End Sub


Or, when you want the order of sheets reversed:
Sub RunMe()
For Each cell In Range("A1:A10")
    Sheets.Add after:=Sheets(Sheets.Count)
    ActiveSheet.Name = cell.Value
Next cell
End Sub


Best regards,
Trowa