• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Create multiple sheets and names based on a list

Dalton Pieters

New Member
Good day

I am having problems with creating multiple sheets(281qty) based on a date range list on my "Sheet1" I want every sheet to have the same template as my "Template" sheet but the names should be based on the list "master sheet" A2:A282

note : the date range list is of workdays for the next year

this is about where i got

Sub CreateSheetsFromAList()
Dim MyCell As Range, MyRange As Range

Set MyRange = Sheets("Sheet1").Range("A2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))

For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = MyCell.Value
Next MyCell
End Sub

but I know I did something wrong
 
Hi:

This portion of you code seems to be wrong
Set MyRange = Sheets("Sheet1").Range("A2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))

do something like this

i&=sheet1.cells(rows.count,1).end(xlup).row
set myrange=sheet1.range("A2:A"&i)

Thanks
 
Back
Top