Mais ton truc c'est sur excel, fallait le dire tout de suite, je viens de me faire chier a ecrire une fonction avec VB
En plus je l'ai testé, elle marche, meme si c'est vrai qu'elle est plutot longue pour si peu, il doit y avoir plus simple.
je te la met quand meme tu peut t'en servir dans une macro (peut-être):
Code :
- Function NombreJourOuvert(LaDate As Date) As Byte
- Dim M As Byte
- Dim A As Integer
- Dim FinMois As Byte
- M = Month(LaDate)
- A = Year(LaDate)
- '##############################################
- 'ce qui a entre les "#" c'est que je sais pas trouver de dernier jour du mois + facilement
- Dim Bys As Boolean
- If Int(A / 4) = A / 4 Then Bys = True
- If M = 1 Then FinMois = 31
- If M = 2 Then
- If Bys = True Then
- FinMois = 29
- Else
- FinMois = 28
- End If
- End If
- If M = 3 Then FinMois = 31
- If M = 4 Then FinMois = 30
- If M = 5 Then FinMois = 31
- If M = 6 Then FinMois = 30
- If M = 7 Then FinMois = 31
- If M = 8 Then FinMois = 31
- If M = 9 Then FinMois = 30
- If M = 10 Then FinMois = 31
- If M = 11 Then FinMois = 30
- If M = 12 Then FinMois = 31
- '############################################
- Dim i As Byte
- Dim TheDate As Date
- For i = 1 To FinMois
- TheDate = i & "/" & M & "/" & A
- If WeekDay(TheDate) > 1 Then
- NombreJourOuvert = NombreJourOuvert + 1
- End If
- Next
- End Function
|
avec cette fonction si tu renvoi a l'argument LaDate la date systeme, il te renverra 26, soit 26 jours ouvrable , j'ai verifié avec le calendrier de windows, c'est ça !
Aller, bonne chance !
Salut !