Avez-vous svp une petite fonction qui vous renvois à partir de la date du jour la date de fin de mois.
Exemple : Nous sommes le 25/06/2008 et la fonction retourne le 30/06/2008.
cette fonction je l'utilise dans mes projets. bn chance
apel: text1.text=fundate(25/06/08)
Function Findate(X As String) As Date
Dim m, a, fj As Integer
On Error GoTo r
m = Month(X)
a = Year(X)
If m <= 7 Then
If m = 2 Then
If a Mod 4 = 0 Then
fj = 29
Else
fj = 28
End If
ElseIf m Mod 2 = 0 Then
fj = 30
Else
fj = 31
End If
Else
If m Mod 2 = 0 Then
fj = 31
Else
fj = 30
End If
End If
Findate = Format(fj & "/" & m & "/" & a, "dd/mm/yy")
Exit Function
r:
MsgBox Err.Description
End Function
avec paramètre :
Private Function GetLastDateOfMonth(ByVal dDate As Date) As Date
GetLastDateOfMonth = DateSerial(Year(dDate), Month(dDate) + 1, 0)
End Function
Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp