Sub Ajouter_ligne()
Application.ScreenUpdating = False
With Feuil1 'CodeName de la feuille
.Protect "toto", UserInterfaceOnly:=True 'mot de passe à adapter
With .[A1].CurrentRegion
.Rows(2).Copy .Rows(.Rows.Count + 1)
On Error Resume Next 'si aucune SpecialCell
.Rows(.Rows.Count + 1).SpecialCells(xlCellTypeConstants) = "" 'efface les constantes
End With
End With
End Sub
Sub Supprimer_ligne()
With Feuil1 'CodeName de la feuille
If ActiveSheet.Name <> .Name Then Exit Sub
.Protect "toto", UserInterfaceOnly:=True 'mot de passe à adapter
With .[A1].CurrentRegion
If .Rows.Count < 3 Then MsgBox "Le tableau doit avoir au moins 2 lignes jaunes", vbInformation, "Supprimer ligne": Exit Sub
If Intersect(ActiveCell, .Cells) Is Nothing Or Not Intersect(ActiveCell, .Rows(1)) Is Nothing Then _
MsgBox "Sélectionnez une cellule jaune", vbInformation, "Supprimer ligne": Exit Sub
Intersect(ActiveCell.EntireRow, .Cells).Delete xlUp
End With
End With
End Sub