Bonjour,
Je me permets de ré-ouvrir le sujet.
Après plusieurs tentatives d'adaptation je n'arrive pas à modifier correctement la macro.
En effet, la macro copie et colle en C2 au lieu de A3 et elle me supprime les cellules A2 et B2.
J'ai beau chercher je ne trouve pas d'où vient le problème.
MACRO:
Sub repartit()
Application.ScreenUpdating = False
Nbfeuil = Array("COMMUN MACHINE", "ALIMENTATION CONIQUE", "ALIMENTATION CONIQUE DOUBLE") ' tableau
For i = LBound(Nbfeuil) To UBound(Nbfeuil) '
Sheets(Nbfeuil(i)).Select
vdl = Range("a1").End(xlDown).Row
vdc = Range("a1").End(xlToRight).Column
Range(Cells(2, 1), Cells(vdl, vdc)).Clear
Next i
Sheets("Fiche de modifs MACHINES").Select
vfl1 = ActiveSheet.Name
vdl = Range("a1").End(xlDown).Row
vdc = Range("a1").End(xlToRight).Column
For i = 2 To vdl
vcel = Cells(i, 2).Value
Select Case vcel
Case "COMMUN MACHINE"
Sheets("COMMUN MACHINE").Select
vfl2 = ActiveSheet.Name
vcel2 = Range("A2").Value
If vcel2 = 0 Or vcel2 = "" Then
vdbl = 2
Else
vdbl = Range("a1").End(xlDown).Row + 1
End If
Sheets(vfl1).Select
Range(Cells(i, 1), Cells(i, 5)).Copy
Sheets(vfl2).Select
Cells(vdbl, 3).Select
ActiveSheet.Paste
Case "ALIMENTATION CONIQUE"
Sheets("ALIMENTATION CONIQUE").Select
vfl2 = ActiveSheet.Name
vcel2 = Range("A2").Value
If vcel2 = 0 Or vcel2 = "" Then
vdbl = 2
Else
vdbl = Range("a1").End(xlDown).Row + 1
End If
Sheets(vfl1).Select
Range(Cells(i, 1), Cells(i, 5)).Copy
Sheets(vfl2).Select
Cells(vdbl, 3).Select
ActiveSheet.Paste
Case "ALIMENTATION CONIQUE DOUBLE"
Sheets("ALIMENTATION CONIQUE DOUBLE").Select
vfl2 = ActiveSheet.Name
vcel2 = Range("A2").Value
If vcel2 = 0 Or vcel2 = "" Then
vdbl = 2
Else
vdbl = Range("a1").End(xlDown).Row + 1
End If
Sheets(vfl1).Select
Range(Cells(i, 1), Cells(i, 5)).Copy
Sheets(vfl2).Select
Cells(vdbl, 3).Select
ActiveSheet.Paste
Case Else
MsgBox "la feuille " & vcel & " n'existe pas, merci de la créer "
Exit Sub
End Select
Sheets(vfl1).Select
Next i
Application.ScreenUpdating = True
Sheets(vfl1).Select
End Sub
Merci
Cordialement
Axel