Raccourcir un code dans une boucle

Résolu/Fermé
mmxa1995 Messages postés 28 Date d'inscription mardi 12 avril 2016 Statut Membre Dernière intervention 21 avril 2016 - 13 avril 2016 à 18:50
Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 - 13 avril 2016 à 19:33
Bonjour,


Sheets("liste").Select

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J614")
ActiveSheet.Range("$F$2") = Range("J614")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J615")
ActiveSheet.Range("$F$2") = Range("J615")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J616")
ActiveSheet.Range("$F$2") = Range("J616")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J617")
ActiveSheet.Range("$F$2") = Range("J617")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J618")
ActiveSheet.Range("$F$2") = Range("J618")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J619")
ActiveSheet.Range("$F$2") = Range("J619")


With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("I614")
ActiveSheet.Range("$F$2") = Range("I614")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("I615")
ActiveSheet.Range("$F$2") = Range("I615")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("J622")
ActiveSheet.Range("$F$2") = Range("J622")

With ActiveWorkbook.ActiveSheet
.Copy After:=Worksheets(Worksheets.Count)
End With
ActiveSheet.Name = Range("I616")
ActiveSheet.Range("$F$2") = Range("I616")

Merci pour votre aide.
Bonne soirée;

A voir également:

1 réponse

Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 1 779
13 avril 2016 à 19:33
0