qu'est-ce qu'y ne va pas avec cette simple fonction en anglais et en français

Le
cherriesbaked
Voici la fonction en anglais:

Function DayName(InputDate As Date)
Dim DayNumber As Integer
DayNumber = Weekday(InputDate, vbSunday)
Select Case DayNumber
Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"
End Select
End Function

Et voici ma traduction en franais:


Function DayName(DateSaisie As Date)

Dim DayNumber As Integer

DayNumber = JOURSEM(DateSaisie, vbdimanche)

Select Case DayNumber

Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"

End Select

End Function


Alors qui a raison qui faux?

Merci

Pascal

Nb.:en fait j'explore excel et vba tout seul et voici ou j'en suis.
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
Clément Marcotte
Le #3801441
vbsunday

biquause Joursem et vblundi n'existent pas en vba



"cherriesbaked"
Voici la fonction en anglais:

Function DayName(InputDate As Date)
Dim DayNumber As Integer
DayNumber = Weekday(InputDate, vbSunday)
Select Case DayNumber
Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"
End Select
End Function

Et voici ma traduction en français:


Function DayName(DateSaisie As Date)

Dim DayNumber As Integer

DayNumber = JOURSEM(DateSaisie, vbdimanche)

Select Case DayNumber

Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"

End Select

End Function


Alors qui a raison qui à faux?

Merci

Pascal

Nb.:en fait j'explore excel et vba tout seul et voici ou j'en suis.
Youky
Le #3801431
Bonsoir,
VBA connait Weekday mais pas Joursem
les formules sont traduites en Francais mais pour VB faut la langue de Bill
Youky
"cherriesbaked"
Voici la fonction en anglais:

Function DayName(InputDate As Date)
Dim DayNumber As Integer
DayNumber = Weekday(InputDate, vbSunday)
Select Case DayNumber
Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"
End Select
End Function

Et voici ma traduction en français:


Function DayName(DateSaisie As Date)

Dim DayNumber As Integer

DayNumber = JOURSEM(DateSaisie, vbdimanche)

Select Case DayNumber

Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"

End Select

End Function


Alors qui a raison qui à faux?

Merci

Pascal

Nb.:en fait j'explore excel et vba tout seul et voici ou j'en suis.
JB
Le #3800661
Function DayName(InputDate As Date)
semaine = Array("Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday")
DayName = semaine(Weekday(InputDate, vbMonday) - 1)
End Function

JB



Voici la fonction en anglais:

Function DayName(InputDate As Date)
Dim DayNumber As Integer
DayNumber = Weekday(InputDate, vbSunday)
Select Case DayNumber
Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"
End Select
End Function

Et voici ma traduction en français:


Function DayName(DateSaisie As Date)

Dim DayNumber As Integer

DayNumber = JOURSEM(DateSaisie, vbdimanche)

Select Case DayNumber

Case 1
DayName = "Sunday"
Case 2
DayName = "Monday"
Case 3
DayName = "Tuesday"
Case 4
DayName = "Wednesday"
Case 5
DayName = "Thursday"
Case 6
DayName = "Friday"
Case 7
DayName = "Saturday"

End Select

End Function


Alors qui a raison qui à faux?

Merci

Pascal

Nb.:en fait j'explore excel et vba tout seul et voici ou j'en suis.


Publicité
Poster une réponse
Anonyme