Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Not IsDate("1-" & Sh.Name) Then Exit Sub
With Sh.Range("B10:AF" & Sh.Rows.Count)
.Validation.Delete 'RAZ
If Intersect(ActiveCell, .Cells) Is Nothing Then Exit Sub
End With
On Error Resume Next
If Weekday(ActiveCell(9 - ActiveCell.Row), 2) > 5 Then Else _
ActiveCell.Validation.Add xlValidateList, Formula1:="=Codes" 'liste de validation
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim c As Range
If Not IsDate("1-" & Sh.Name) Then Exit Sub
Set Target = Intersect(Target, Sh.Range("B10:AF" & Sh.Rows.Count), Sh.UsedRange)
If Target Is Nothing Then Exit Sub
On Error Resume Next
For Each Target In Target 'si entrées/effacements multiples
Target.Interior.ColorIndex = xlNone 'RAZ
Target.Font.ColorIndex = xlAutomatic 'RAZ
Set c = [Codes].Find(Target, , xlValues, xlWhole)
If c Is Nothing Or Weekday(Target(9 - Target.Row), 2) > 5 Then
If Target <> "" Then Target = ""
Else
Target.Interior.Color = c.Interior.Color
Target.Font.Color = c.Font.Color
End If
Next
End Sub