|
|
|
|
Bonjour tout le monde.
Voici un bout de code de ma composition:
While (Sheet2.Cells(indLigne, "E").Value <> "" Or (result = False))
If (param = dateCourante) Then
result = True
End If
dateCourante = CDate(Sheet2.Cells(indLigne, "E").Value)
indLigne = indLigne + 1
Wend
Configuration: Windows XP Internet Explorer 6.0
Bonjour,
|
Effectivement, result est a False et param est bien initialisé.
Function Ferie(param As Date) As Boolean
Dim result As Boolean
Dim indLigne As Integer
Dim dateCourante As Date
result = False
indLigne = 2
dateCourante = CDate(Sheet2.Cells(indLigne, "E").Value)
While (Sheet2.Cells(indLigne, "E").Value <> "" Or (result = False))
If (param = dateCourante) Then
result = True
End If
dateCourante = CDate(Sheet2.Cells(indLigne, "E").Value)
indLigne = indLigne + 1
Wend
Ferie = result
End Function
Précision sur la condition avec le Or: si l'un des deux élément est faux, alors elle devient fausse. (enfin il me semble) What's tiny, and yellow and very very dangerous????? A canary with the super-user password. Mouhahahaha |
Bonjour,
Function Ferie(param As Date) As Boolean
Dim indLigne As Integer
indLigne = 2
While (Sheet2.Cells(indLigne, "E").Value <> ""
If (Sheet2.Cells(indLigne, "E").Value = dateCourante) Then
Ferie= True
Exit Function
End If
indLigne = indLigne + 1
Wend
Ferie = False
End Function
;o) «Ce que l'on conçoit bien s'énonce clairement, Et les mots pour le dire arrivent aisément.» Nicolas Boileau |
Okey je teste et je te redis si sa fonctionne pour moi
Function Ferie(param As Date) As Boolean
Dim indLigne As Integer
indLigne = 2
While (Sheet2.Cells(indLigne, "E").Value <> ""
If (Sheet2.Cells(indLigne, "E").Value = dateCourante) Then
Ferie= True
Exit Function
End If
indLigne = indLigne + 1
Wend
Ferie = False
End Function
C'est pas dateCourante mais param qu'il fallait mettre. En tout cas merci beaucoup sa fonctionne maintenant What's tiny, and yellow and very very dangerous????? A canary with the super-user password. Mouhahahaha |