Worksheet name from list

dave bates

Board Regular
Joined
Jul 7, 2008
Messages
106
Hi, help please with creating worksheets in a workbook

Im using Excel 2016

I have a VB to create new worksheets based on a list of names on a summary sheet but I would like the new worksheets to be to set layout including column widths, formats and formula. Is the easiest way to do this to extend the VBA to do a copy and paste special to all of the sheets when created.

The VBA that I'm using to create the worksheets is

Sub AddNamedSheets()
Dim i&
With sheets ("Sheet1")
For i = 52 To 2 Step-1
sheets.Add.Name=.Cells(i,"A").Value
Next i
End With
End Sub

thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi, how about copying a "master" sheet that already has the layout, formulas etc rather than creating new sheets and back applying.

Something like this, where, for example, the name of the pre-formatted sheet is "master"

Rich (BB code):
Sub AddNamedSheets()
Dim i&
Application.ScreenUpdating = False
With Sheets("Sheet1")
    For i = 52 To 2 Step -1
        Sheets("master").Copy Before:=Sheets(1)
        ActiveSheet.Name = .Cells(i, "A").Value
    Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,203
Members
452,617
Latest member
Narendra Babu D

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