Re : Amélioration d'un calendrier + calcul automatique de prime
Pour ton fichier du post 9, hormis la cellule B6, il n'y a plus de formules dans toutes les lignes 6, 16 ,26, ....
En conséquence, par exemple, entre les dates (ligne 27) et les jours ligne 26, on n'a pas la même date
Il faut recopier la formule en B6 sur toute la ligne et ensuite recopier toute la ligne 6 sur les lignes 16, 26 , ....
Supprime le nom de cellule a (qui fait doublon avec le nom An)
Il te manque une partie du programme (la partie en gras).
Sub jours_fériés()
Application.ScreenUpdating = False
Sheets("Feuil1").Activate
For i = 6 To 107 Step 10
Set plage = Range("B" & i & ":AQ" & i)
For Each cel In plage
Range("An") = Year(cel)
a = Weekday(cel, 2)
If Weekday(cel, 2) = 7 Or _
Weekday(cel, 2) = Range("AZ1").Value Then
Range(Cells(i, cel.Column), Cells(i + 7, cel.Column)).Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
GoTo suite
Else
Range(Cells(i, cel.Column), Cells(i + 7, cel.Column)).Select
With Selection.Interior
.ColorIndex = xlNone
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
'Stop
For Each cl In Range("BC8:BC20")
If cl = cel Then
Range(Cells(i, cel.Column), Cells(i + 7, cel.Column)).Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next
suite:
Next
' Stop
Next
End Sub