Function annive(Annee, Mois)
'
Dim i As Long, l As Long, col As Long, lig As Long, nbjours As Long
Application.DisplayAlerts = False
Application.ScreenUpdating = False
nbjours = Day(DateSerial(Annee, Mois + 1, 0)) ' Nombre de jours dans le mois passé en paramètre
For Each fc In ActiveWorkbook.Worksheets
With Worksheets("Paramètre")
If fc.Name = .Range("C3") & "_" & .Range("B3") Then
fc.Activate
derlig = Range("A" & Rows.Count).End(xlUp).Row
col = 3
fc.Range("C" & derlig - 1 & ":AG" & derlig) = ""
For i = 1 To nbjours
anniv = ""
With Sheets("Paramètre").ListObjects("t_Anniv")
For k = 1 To .ListRows.Count
If Month(.ListColumns("Date").DataBodyRange(k)) = Mois And Day(.ListColumns("Date").DataBodyRange(k)) = i Then
anniv = anniv & .ListColumns("Anniversaire").DataBodyRange(k)
If .ListColumns("Inconnu").DataBodyRange(k) = "x" Then
anniv = anniv & "," & vbCrLf
Else
If Annee - Year(.ListColumns("Date").DataBodyRange(k)) = 0 Then
age = "(Naissance)"
Else
age = "(" & Annee - Year(.ListColumns("Date").DataBodyRange(k)) & " ans)"
End If
anniv = anniv & " " & age & "," & vbCrLf
End If
End If
Next k
If anniv <> "" Then
anniv = Left(anniv, Len(anniv) - 3)
fc.Cells(derlig - 1, col) = "Anniversaire de :"
fc.Cells(derlig, col) = vbCrLf & anniv
fc.Cells(derlig, col).VerticalAlignment = xlTop
End If
End With
col = col + 1
Next i
End If
End With
Next fc
' Worksheets("Paramètre").Activate
End Function