Sub Ligne_insérer_si_emplacement_ok()
Dim n, L As Range
Set L = ActiveCell.EntireRow
ActiveSheet.Unprotect
If Selection.Row < 18 Then
MsgBox "Opération interdite avant la ligne 18 !"
Else
n = InputBox("Combien de ligne : 1,3, 5 ?", "Choix", 1) 'nombre de lignes à insérer
Rows("14:1058").Select
Selection.EntireRow.Hidden = False
ActiveSheet.Outline.ShowLevels RowLevels:=2
Selection.AutoFilter
Rows("1:1").Select
Selection.EntireRow.Hidden = True
L(2).Resize(n).Insert
Rows(1).EntireRow.Hidden = False
Rows(1).Copy L(2).Resize(n)
L(2).Resize(n).RowHeight = L(n - 1).RowHeight
Rows(1).EntireRow.Hidden = True
Selection.AutoFilter
End If
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
End Sub