Bonjour , j'ai besoin d'aide pour ce code :
Si la date se trouve soit dans la colonne S11 , soit dans la colonne T11 ou les 2 lancer "Anniversaire"
Merci pour votre aide
Code:
Option Explicit
Dim I As Integer
Public MaDate As Date
Dim PremJour As Date
Function Suivante()
' Si la date suivante se trouve soit dans la colonne S11 soit dans T11 ou les 2 lancer la fonction Anniversaire
On Error Resume Next
I = 1
PremJour = MaDate
PremJour = PremJour + 1
Do While Day(PremJour) & Month(PremJour) <> Day(MaDate) & Month(MaDate)
Do While Range("[Car]Fichier!A11").Offset(I, 0) <> ""
If Range("[Car]Fichier!S11").Offset(I, 0) <> "" Then
If Day(Range("[Car]Fichier!S11").Offset(I, 0)) & Month(Range("[Car]Fichier!S11").Offset(I, 0)) = Day(PremJour) & Month(PremJour) Then
' If Range("[Car]Fichier!T11").Offset(I, 0) <> "" Then
' If Day(Range("[Car]Fichier!T11").Offset(I, 0)) & Month(Range("[Car]Fichier!T11").Offset(I, 0)) = Day(PremJour) & Month(PremJour) Then
MaDate = PremJour
Anniversaire
Exit Function
End If
End If
I = I + 1
Loop
I = 1
PremJour = PremJour + 1
Loop
End Function
Si la date se trouve soit dans la colonne S11 , soit dans la colonne T11 ou les 2 lancer "Anniversaire"
Merci pour votre aide