Bonjour le Fil, le Forum, Jean Pierre, SpeedBall, Banzai64
On peut le faire en évènementielle, mais bon c'est quand même assez tordu comme truc....
Voici le code :
Code:
Option Explicit
Private Locked As Boolean
Private PlageA As Range, PlageB As Range
Private Sub Worksheet_Change(ByVal Target As Range)
If Locked = True Then Exit Sub
If Not IsNumeric(Target.Value) Then Exit Sub
Set PlageA = Application.Union(Range("C6:C56"), Range("H5:H56"))
Set PlageB = Application.Union(Range("D6:D56"), Range("I5:I56"))
If Not Application.Intersect(Target, PlageA) Is Nothing Or _
Not Application.Intersect(Target, PlageB) Is Nothing Then
Locked = True
Score Target
Locked = False
End If
End Sub
Private Sub Score(ByRef Target As Range)
Dim MaxMatch As Byte
Dim Col As Integer
Select Case Left(Range("E4"), 1)
Case "D"
MaxMatch = 10
Case "N"
MaxMatch = 14
End Select
If Target.Column = 3 Or Target.Column = 8 Then
Col = 1
Else
Col = -1
End If
Target.Offset(0, Col) = MaxMatch - Target.Value
End Sub
J'ai aussi mis le fichier pour tester...
Bonne soirée
@+Thierry