Add sheet and name it. Please help. VBA to add 107 sheets

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,
I want my activeworkbook to add 107 sheets and name sheets as per value from V2 to V108. Is that posible? I current have only one sheet
I want sheet2.name = range v2.value for example and go one till all 107 more sheets are added and name.
Thanks for helping.
Pedie
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try

Code:
Sub AddSheets()
Dim ws As Worksheet, i As Long
Set ws = ActiveSheet
For i = 2 To 108
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = ws.Range("V" & i).Value
Next i
End Sub
 
Upvote 0
Assuming your names in the V range are on sheet 1? If so, try:
Code:
Sub NameMySheets ()
Application.ScreenUpdating = False
Dim i as Long
For i = 2 to 108
  Sheets.Add(after:=Sheets(Worksheets.Count)).Name = Sheets("Sheet1").Range("V" & i)
Next i
End Sub
 
Upvote 0
Why would you want a workbook with that many sheets in it?
 
Upvote 0
I look forward to the follow up questions about creating summary reports from 107 worksheets. ;)
 
Upvote 0
Pedie, please don't tell us the ONLY difference in the sheets is ONE item (Cell), such as Client Name, Date, or some number reference!!
lenze
 
Upvote 0
Vog, thank you so much. it worked perfectly.

May I please ask somemore question.
I have code thats works file.
The blue line is where I need help.
After Windows("Book1.xlsm").Activated i want
code to look for sheetname equal to activeworkbook range("B1").value then go ahead with my code
Code:
ActiveWorkbook.Activate
         Sheet1.Range("C50:L50").Copy
    Windows("Book1.xlsm").Activate
             [COLOR=blue]Worksheets("????").Activate[/COLOR]

Vog, thank alot again for always being good to me;)
 
Upvote 0

Forum statistics

Threads
1,226,225
Messages
6,189,735
Members
453,566
Latest member
ariestattle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top