Copier coller page de cellule vers nouvelle feuille

ludo93

XLDnaute Nouveau
Bonjour

Apres a voir regarder sur le forum mais sans trouver mon bonheur j'expose mon problème

Je voudrais copier une sélection de page vers un nouvelle onglet
Personne 1 vers onglet personne 1 Personne 2 vers onglet personne 2 etc ...

Merci d'avance de votre aide

Je reste sur le fil de la discutions si besoin de plus d'explication
 

Pièces jointes

  • test fiches.xls
    75 KB · Affichages: 21

mapomme

XLDnaute Barbatruc
Supporter XLD
Bonjour ludo83,

Voir fichier joint. Le code est dans le module de code de la feuille LISTING.
VB:
Sub ventiler()
Dim i&, j&, nom$, ind&

  Application.ScreenUpdating = False
  With Worksheets("LISTING")
    For i = 4 To .Rows.Count Step 180
      For j = 4 To 8 Step 4
        nom = .Cells(i + 1, j)
        If Trim(nom) = "" Then Exit For
        On Error Resume Next
        ind = 0: ind = Worksheets(nom).index
        On Error GoTo 0
        If ind = 0 Then
          ThisWorkbook.Worksheets.Add after:=Worksheets(Worksheets.Count)
          ActiveSheet.Name = nom
          ind = Worksheets(nom).index
        End If
        .Range("1:3").Copy Worksheets(ind).Range("1:3")
        .Range("a4:c179").Copy Worksheets(ind).Range("a4")
        .Range("d4:f179").Offset(i - 4, j - 4).Copy Worksheets(ind).Range("d4")
        .Range("a:j").Copy
        Worksheets(ind).Range("a:f").Columns.AutoFit
      Next j
    Next i
  End With
  Application.CutCopyMode = False
End Sub
 

Pièces jointes

  • ludo93- test fiches.xls- v1.xls
    83 KB · Affichages: 16

Discussions similaires