Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'Forumeur : Piwwwa
'Auteur : TheBenoit59
'Lien : http://www.excel-downloads.com/forum/242920-copier-coller-x-fois-uniquement-la-premiere-ligne-de-mon-ficheir.html
Dim n As Integer, l As Integer 'Variable du nombre de copie "n", variable de la ligne "l"
Dim fActions As Worksheet, fEmployee As Worksheet 'Variable des feuilles
Dim dl As Long 'Variable dernière ligne du classeur employée
Set fActions = ThisWorkbook.Sheets("Actions"): Set fEmployee = ThisWorkbook.Sheets("Employee")
dl = fEmployee.[a65000].End(xlUp).Row + 1
If Not Application.Intersect(Target, fActions.Range("c2:c3")) Is Nothing Then 'On cherche s'il existe une modification en C2 ou C3
l = Target.Row
With fActions
If .Cells(l, 8).Value <> "Training" Then Exit Sub 'Si la valeur en colonne H est différente de Training on quitte la procédure
n = .Cells(l, 3).Value 'On détermine le nombre de copies
.Range(.Cells(l, 1), .Cells(l, 2)).Copy fEmployee.Cells(dl, 1).Resize(n) 'On copie et on colle selon le nombre "n"
.Range(.Cells(l, 3), .Cells(l, 7)).Copy fEmployee.Cells(dl, 8).Resize(n)
Application.CutCopyMode = False 'On vide le presse-papier
End With
Target.Select 'Pour se replacer sur la cellule modifiée
End If
End Sub