merci de votre disponibilité et j'ai modifié le code et maintenant ca marche, merci encore et à bientot
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Target.Select
x = ActiveCell.Row
y = ActiveCell.Column
Application.EnableEvents = False
If Not Intersect(Target, Cells(x, y)) Is Nothing Then
If Now() >= Range("b2") And Now() <= Range("b3") Then
On Error Resume Next
If Target.Value = "" Then
Target.Selection.ClearComments
Range(x, y).Offset(39, 0).Value = ""
End If
Cells(x + 39, y) = ActiveCell.Value
Cells(x, y).AddComment
Cells(x, y).Comment.Visible = False
Cells(x, y).Comment.Text Text:="1er semèstre"
If Target.Value = "" Then
Target.ClearComments
End If
End If
If Now() >= Range("b5") And Now() <= Range("b6") Then
On Error Resume Next
If Target.Value = "" Then
Cells(x, y).Selection.ClearComments
Range(x, y).Offset(66, 0).Value = ""
End If
Cells(x + 66, y) = ActiveCell.Value
Cells(x, y).AddComment
Cells(x, y).Comment.Visible = False
Cells(x, y).Comment.Text Text:="2ème semèstre"
If Target.Value = "" Then
Target.ClearComments
End If
End If
End If
Target.Select
Application.EnableEvents = True
End Sub