OVH Cloud OVH Cloud

Semaine Paire Semaine Impaire

1 réponse
Avatar
Yannick P
Bjr

J'utilise cette macro pour définir les jours de temps partiel d'agents

If Weekday(Cells(5, cc), 2) = 1 Then
Cells(15, cc).Value = "TP"
With Cells(15, cc).Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells(15, cc).Font.ColorIndex = 15
End If


Comment faire pour différencier les semaines paires des Semaines impaires...

1 réponse

Avatar
Youky
Salut bien,
avec la date en A1
Youky

D = Int([A1])
NOSEM = DateSerial(Year(D + (8 - Weekday(D)) Mod 7 - 3), 1, 1)
NOSEM = ((D - NOSEM - 3 + (Weekday(NOSEM) + 1) Mod 7)) 7 + 1
If NOSEM Mod 2 = 0 Then
MsgBox "paire"
Else
MsgBox "impaire"
End If

"Yannick P" a écrit dans le message de news:
44d61b69$0$841$
Bjr

J'utilise cette macro pour définir les jours de temps partiel d'agents

If Weekday(Cells(5, cc), 2) = 1 Then
Cells(15, cc).Value = "TP"
With Cells(15, cc).Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Cells(15, cc).Font.ColorIndex = 15
End If


Comment faire pour différencier les semaines paires des Semaines
impaires...