Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
'Feuil3 est le CodeName de la feuille Liste
If Sh.CodeName = "Feuil3" Or _
Target.Address <> ActiveCell.MergeArea.Address Then Exit Sub
Dim plage As Range, h As Long
If Application.CutCopyMode Then Sh.Paste 'pour le Copier/Coller
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error Resume Next 'si [Ajout] n'existe pas
Sh.[Ajout].Delete
Set plage = Feuil3.Range("A1", Feuil3.[A1].End(xlDown))
h = plage.Count
If h < Rows.Count Then 'au moins 2 éléments dans la liste
plage.EntireRow.Copy
Target.EntireRow.Insert
With Target.Offset(-h).Resize(h)
.EntireRow.ClearContents
plage.Copy .Cells
.EntireRow.Hidden = True
Sh.Names.Add "Ajout", .EntireRow
End With
Target.Select
End If
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range)
If Source.Count > 1 Then Exit Sub
Dim memsource As Range
Application.EnableEvents = False
On Error Resume Next
Set memsource = Source.MergeArea
memsource.UnMerge 'défusionne
Feuil3.Cells(Application.Match(Source, Feuil3.[A:A], 0), 1).Copy Source
memsource.Merge 'refusionne
Application.EnableEvents = True
End Sub