Dim oldrow As Long ' N° de ligne (Origine)
Dim oldrowheight As Double ' Hauteur de ligne (Origine)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
'
If Target.Row >= 4 And Target.Row <= 15 Then
' Si il y a un historique N° ligne d'origine Modifier !
If oldrow > 0 Then
Application.EnableEvents = False
Cells(16, 1).Resize(, 5).Copy: Cells(oldrow, 1).Resize(, 5).PasteSpecial _
Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
' Hauteur de la ligne
Cells(oldrow, 1).EntireRow.RowHeight = oldrowheight
' N° ligne et Hauteur ligne (Origine)
oldrow = 0
oldrowheight = 15
Application.EnableEvents = True
'
Application.CutCopyMode = False
End If
' Copie la ligne d'origine : Format et colle fomat en Ligne 16.
With Cells(Target.Row, 1).Resize(, 5)
.Copy: Range("A16").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
' Rerise a 0 de la procedure suite a un changement
' Puis reprend ici pour stoker les valeurs dans les variables
oldrow = .Row
oldrowheight = .RowHeight
' Ligne d'origine Modifier
.Font.Color = vbBlack
.RowHeight = 40
.Interior.Color = RGB(255, 150, 100)
Application.CutCopyMode = False
End With
End If
End Sub