Dim oFeuille As WorkSheet ... If cel.Value <> "" Then On Error Resume Next ' pour éviter erreur si elle n'existe pas Set oFeuille = Sheets(cel.Value) On Error Goto 0 ' retour à la normale If oFeuille Is Nothing Then Sheets.Add After:=Sheets(Sheets.Count) ActiveSheet.Name = cel.Value End If End If
Sub Ajout_Feuil() Dim oFeuille As Worksheet Sheets("test").Range("A5").Select Set plg = Range("A5", Range("A5").End(xlDown)) Application.ScreenUpdating = False For Each cel In plg.Cells If cel.Value <> "" Then On Error Resume Next ' pour éviter erreur si elle n'existe pas Set oFeuille = Sheets(cel.Value) On Error GoTo 0 ' retour à la normale If oFeuille Is Nothing Then Sheets.Add After:=Sheets(Sheets.Count) ActiveSheet.Name = cel.Value End If End If Next End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionActiveSheet.Hyperlinks.Add Anchor:=Range(""), Address:="", SubAddress:= _ "", TextToDisplay:=""