en fait la variable est aussi déclarée en tête d'un module.
Le private de la feuille était un essai.
H2SO4 voici le code demandé : Worksheet_SelectionChange(ByVal Target As Range)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim F As Variant
Dim IC As Long
Dim iR As Long
Dim image1 As Shape
' gestion de la position de l'image pour insérer une ligne
If ActiveCell.Row <= 6 Then
Shapes("image1").Visible = False
Shapes("image1").Left = 530
Else
Shapes("image1").Visible = True
Shapes("image1").Top = Target.Top + 10
Shapes("image1").Left = 530
End If
'--------------------------------------
'remplace les liens hypertexte
F = Range("G" & Target.Row).Value
classe = ActiveCell
Lin = ActiveCell.Row
On Error Resume Next
If Target.Column = 18 And Target.Row > 5 And Target.Row < 1000 And F <> "" Then
Application.EnableEvents = False
'Si la date est postérieure met un croix sinon efface
If Cells(Lin, "P") > Now Or Cells(Lin, "P") = "" Then
Cells(Lin, "S") = "x"
Else
Cells(Lin, "S") = ""
End If
' ' contrôler la date nouvellement entrée
' If sgf.Cells(Lin, "P") <= Now And Cells(Lin, "S") = "x" Then
'
' End If
Range("R" & Target.Row).Select
Cells(Lin, 17).Select ' range le curseur sur la colonne 17
tester ' lance la macro du nom
Application.EnableEvents = True
End If
If Target.Column = 7 And Target.Row >= 6 And Target.Row < 1000 _
And classe <> "" And Cells(Lin, 25) = 1 Then
Range("G" & Target.Row).Select
MsgBox "Vous devez avant tout supprimer les compétences avant de changer de niveau de classe"
End If
On Error Resume Next
If Not Intersect(ActiveCell, [E6:Q1006]) Is Nothing Then
' Application.ScreenUpdating = False
With Range("E6:X1006")
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
' ligne trait
iR1 = ActiveCell.Row
With Range("E" & iR1 & ":X" & iR1)
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).ColorIndex = 1 ' NOIR
End With
End If
End Sub