Sub Insertion()
[COLOR="red"]ActiveSheet.Unprotect [/COLOR]
derlig = Range("A6").End(xlDown).Row + 1 'recherche première ligne vide
Rows(derlig).Select
Selection.Insert Shift:=xlDown 'Insertion à la première ligne vide
'*********Mise en forme
' A améliorer
ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select
Selection.Copy
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(-1, 0).Range("A1:E1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(-1, 3).Range("A1:B1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-2, 0).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.Offset(1, -3).Range("A1:E1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
' Aller à "Cout_de_l_action" et modifie les formules
Application.Goto Reference:="Cout_de_l_action"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Formula = "=SUM(D10:D" & [D10].End(xlDown).Row & ")"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Formula = "=SUM(E10:D" & [E10].End(xlDown).Row & ")"
[COLOR="Red"]ActiveSheet.Protect [/COLOR]
End Sub