Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("G6:AS21")) Is Nothing And Target = "x" Then
colonne = Target.Column
verticalfin = Target.Left + 10
horizontalfin = Target.Top + 10
For i = 6 To 21
If Cells(i, colonne - 1) = "x" Then
verticaldeb = Cells(i, colonne - 1).Left + 10
horizontaldeb = Cells(i, colonne - 1).Top + 10
Exit For
End If
Next i
Set feuille = ActiveSheet
With feuille.Shapes.AddLine(verticaldeb, horizontaldeb, verticalfin, horizontalfin).Line
.DashStyle = msoLineDashDotDot
.ForeColor.RGB = RGB(50, 0, 128)
End With
End If
End Sub