Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'*** Définition des variables ***
w = ActiveCell.Width
t = ActiveCell.Top
l = ActiveCell.Left
h = 2 * ActiveWindow.UsableWidth
'----------------------------------
'Teste si les rectangles existent déjà.
On Error Resume Next
ActiveSheet.Shapes("RectangleV").Delete
On Error GoTo 0
'Ajoute les rectangles
ActiveSheet.Shapes.AddShape(msoShapeRectangle, l, 0, w, h).Name = "RectangleV"
With ActiveSheet.Shapes("RectangleV")
.Fill.Visible = msoFalse
.Fill.Transparency = 1#
.Line.Weight = 2#
.Line.ForeColor.SchemeColor = 2 'rouge
.ControlFormat.PrintObject = False
End With
End Sub