Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("H4:H15"), Target) Is Nothing And Target.Count = 1 Then
Target = Int(Range("E" & Target.Row) - Sheets("Année 2016").Range("E16"))
Cancel = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("E4:E15"), Target) Is Nothing And Target.Count = 1 Then
If IsNumeric(Target) And Target <> "" Then
Application.EnableEvents = False
Target.Formula = "=" & Target & "+'Année 2016'!E16"
Application.EnableEvents = True
End If
Cancel = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'Lancer la macro DeplacerCommentaires.Cliquer sur cellule d'origine des commentaires => OK puis cellule de Destination => OK
If Target.Count > 1 Then Exit Sub
If Intersect(Target, [A2:A16], [F2:F16]) Is Nothing Then Exit Sub 'Jouer sur [[A2:A16], [F2:F16] pour la plage des commentaires à déplacer
If Not Target.Comment Is Nothing Then
Cancel = True
End If
End Sub