cs_tolt
Messages postés269Date d'inscriptionmardi 17 décembre 2002StatutMembreDernière intervention 4 avril 2019
-
25 juin 2008 à 17:55
badanaro
Messages postés2Date d'inscriptionvendredi 10 janvier 2003StatutMembreDernière intervention19 août 2008
-
19 août 2008 à 17:33
Bonjour,
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.
GURDOUS
Messages postés25Date d'inscriptionmercredi 10 mars 2004StatutMembreDernière intervention18 décembre 2008 25 juin 2008 à 18:20
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