Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set champ = [A3:NC90]
If Not Intersect(champ, Target) Is Nothing Then
On Error Resume Next
Shapes("curseurH1").Visible = True
If Err <> 0 Then ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 1, 1, 1000, 1).Name = "curseurH1"
Shapes("curseurH2").Visible = True
If Err <> 0 Then ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 1, 1, 1000, 1).Name = "curseurH2"
Shapes("curseurV1").Visible = True
If Err <> 0 Then ActiveSheet.Shapes.AddTextbox(msoTextOrientationVertical, 1, 1, 1000, 1).Name = "curseurV1"
Shapes("curseurV2").Visible = True
If Err <> 0 Then ActiveSheet.Shapes.AddTextbox(msoTextOrientationVertical, 1, 1, 1000, 1).Name = "curseurV2"
ActiveSheet.Shapes("curseurH1").Line.ForeColor.RGB = RGB(255, 0, 0) ' trait du dessous
Shapes("curseurH1").Top = ActiveCell.Top + ActiveCell.Height
Shapes("curseurH1").Left = champ.Left
Shapes("curseurH1").Height = 0.2
Shapes("curseurH1").Width = champ.Width
ActiveSheet.Shapes("curseurH2").Line.ForeColor.RGB = RGB(255, 0, 0) ' trait du dessus
Shapes("curseurH2").Top = ActiveCell.Top '+ ActiveCell.Height
Shapes("curseurH2").Left = champ.Left
Shapes("curseurH2").Height = 0.2
Shapes("curseurH2").Width = champ.Width
ActiveSheet.Shapes("curseurV1").Line.ForeColor.RGB = RGB(255, 0, 0) ' trait de gauche
Shapes("curseurV1").Top = champ.Top ' + ActiveCell.Height
Shapes("curseurV1").Left = ActiveCell.Left ' + ActiveCell.Height
Shapes("curseurV1").Height = champ.Height
Shapes("curseurV1").Width = 0.2
ActiveSheet.Shapes("curseurV2").Line.ForeColor.RGB = RGB(255, 0, 0) ' Trait de droite
Shapes("curseurV2").Top = champ.Top '+ ActiveCell.Height
Shapes("curseurV2").Left = ActiveCell.Left + ActiveCell.Width
Shapes("curseurV2").Height = champ.Height
Shapes("curseurV2").Width = 0.2
Else
On Error Resume Next
Shapes("curseurH1").Visible = False
Shapes("curseurH2").Visible = False
Shapes("curseurV1").Visible = False
Shapes("curseurV2").Visible = False
End If
End Sub