Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Flag Then Exit Sub
If Not Application.Intersect(Target, Range("Designation")) Is Nothing Then
Dim Lg%, Rep$
Dim r As Range
With Sheets("doc")
Lg = .Range("Nota").End(xlUp)(2).Row '48 maxi
If .Range("Nota").Row - Lg <= 5 Then
Application.CutCopyMode = False
.Rows(Lg).Copy
.Range(.Rows(Lg), .Rows(Lg + 5)).Insert
Application.CutCopyMode = False
MsgBox ("Insertion de 5 lignes")
End If
Rep = InputBox(ActiveCell & Chr(10) & Chr(10) & "Quantité ?")
If Rep = "" Then Exit Sub
.Activate
Set r = Application.InputBox("Sélectionner la ligne d'insertion.", Type:=8)
Lg = r.Row
.Rows(Lg).EntireRow.Insert shift:=xlDown
Target.Offset(0, 5) = Rep
.Range("c" & Lg) = Target
.Range("d" & Lg) = Target.Offset(0, 1)
.Range("e" & Lg) = Target.Offset(0, 10)
.Range("h" & Lg) = Target.Offset(0, 2)
.Range("o" & Lg) = Target.Offset(0, 3)
.Range("j" & Lg) = Target.Offset(0, 4)
.Range("r" & Lg) = Target.Offset(0, 6)
.Range("f" & Lg) = Rep
.Activate
End With
End If
End Sub