try:Sub CREATE_FICHE_PERSO2() ' ' CREATE_FICHE_PERSO Macro 'This will create a file from a template called Fiche_Perso for every team from a range of 12 teams called Teams in worksheet PICK 'It will also name each worksheet with the name of each team Dim ws As Worksheet Dim Ct As Long Dim c As Range Set ws = Worksheets("sheet_perso") ws.Visible = True For Each c In Sheets("PICK").Range("Teams") If c.Value <> "" Then ws.Copy before:=Sheets("sheet_perso") 'copy new Fiche perso With ActiveSheet .Name = c.Value 'Name the new sheet .Range("C2") = c.Value c.Offset(, 1).Resize(, 3).Copy .Range("P2") End With Ct = Ct + 1 End If Next c ws.Visible = False If Ct > 0 Then MsgBox Ct & " new sheets created from list" Else MsgBox "no name on list" End If End Sub





Reply With Quote