Bonjour,
j'ai trouve cette macro
Function TYPEJOUR(D As Date)
'L. Longre
Dim A As Integer, T As Integer
Dim LP As Date, LD As Long
Dim Toto As Long
A =3D Year(D)
If A > 2099 Then
TYPEJOUR =3D CVErr(xlErrValue)
Exit Function
End If
LD =3D Int(D)
If LD <=3D 2 Then
If LD =3D 1 Then TYPEJOUR =3D 2
Exit Function
End If
T =3D (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21
LP =3D DateSerial(A, 3, 2) + T + (T > 48) _
+ 6 - ((A + A \ 4 + T + (T > 48) + 1) Mod 7)
Select Case D
' Jours f=E9ri=E9s mobiles
Case Is =3D LP, Is =3D LP + 38, Is =3D LP + 49
TYPEJOUR =3D 2
' Jours f=E9ri=E9s fixes
Case Is =3D DateSerial(A, 1, 1), Is =3D DateSerial(A, 5, 1), _
Is =3D DateSerial(A, 5, 8), Is =3D DateSerial(A, 7, 14), _
Is =3D DateSerial(A, 8, 15), Is =3D DateSerial(A, 11, 1), _
Is =3D DateSerial(A, 11, 11), Is =3D DateSerial(A, 12, 25)
TYPEJOUR =3D 2
Case Else
' Samedi ou dimanche
If Weekday(D, vbMonday) >=3D 6 Then TYPEJOUR =3D 1
End Select
End Function
et quand je rentre dans mFC =3DTYPEJOUR(B4)=3D2 cela ne fonctione pas et je
retrouve ceci dans la MFC =3D"=3DTYPEJOUR(B4)=3D2"
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
je ne volis pas ce qui cloche
bonjour
elle fonctionne très bien
si en A2 tu as une date
dans une autre cellule de ton choix tu peux inscrire ceci
"LeSurCitaire" <donzel-gargand.jacques@tiscali.fr> a écrit dans le message
de news: 1125479793.049971.15900@g49g2000cwa.googlegroups.com...
Bonjour,
j'ai trouve cette macro
Function TYPEJOUR(D As Date)
'L. Longre
Dim A As Integer, T As Integer
Dim LP As Date, LD As Long
Dim Toto As Long
A = Year(D)
If A > 2099 Then
TYPEJOUR = CVErr(xlErrValue)
Exit Function
End If
LD = Int(D)
If LD <= 2 Then
If LD = 1 Then TYPEJOUR = 2
Exit Function
End If
T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21
LP = DateSerial(A, 3, 2) + T + (T > 48) _
+ 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7)
Select Case D
' Jours fériés mobiles
Case Is = LP, Is = LP + 38, Is = LP + 49
TYPEJOUR = 2
' Jours fériés fixes
Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _
Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _
Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _
Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25)
TYPEJOUR = 2
Case Else
' Samedi ou dimanche
If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1
End Select
End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je
retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
je ne volis pas ce qui cloche
Yvan
Bonjour *LeSurCitaire*
J'ai fait la même expérience et j'ai eu le même résultat. Seulement, l'avais oublié de taper le premier signe =.
En recommençant avec le signe = en début de condition, çà fanctionne parfaitement.
@+
Yvan
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
je ne volis pas ce qui cloche
Bonjour *LeSurCitaire*
J'ai fait la même expérience et j'ai eu le même résultat. Seulement, l'avais
oublié de taper le premier signe =.
En recommençant avec le signe = en début de condition, çà fanctionne
parfaitement.
@+
Yvan
"LeSurCitaire" <donzel-gargand.jacques@tiscali.fr> a écrit dans le message
de news: 1125479793.049971.15900@g49g2000cwa.googlegroups.com...
Bonjour,
j'ai trouve cette macro
Function TYPEJOUR(D As Date)
'L. Longre
Dim A As Integer, T As Integer
Dim LP As Date, LD As Long
Dim Toto As Long
A = Year(D)
If A > 2099 Then
TYPEJOUR = CVErr(xlErrValue)
Exit Function
End If
LD = Int(D)
If LD <= 2 Then
If LD = 1 Then TYPEJOUR = 2
Exit Function
End If
T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21
LP = DateSerial(A, 3, 2) + T + (T > 48) _
+ 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7)
Select Case D
' Jours fériés mobiles
Case Is = LP, Is = LP + 38, Is = LP + 49
TYPEJOUR = 2
' Jours fériés fixes
Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _
Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _
Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _
Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25)
TYPEJOUR = 2
Case Else
' Samedi ou dimanche
If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1
End Select
End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je
retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
J'ai fait la même expérience et j'ai eu le même résultat. Seulement, l'avais oublié de taper le premier signe =.
En recommençant avec le signe = en début de condition, çà fanctionne parfaitement.
@+
Yvan
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
je ne volis pas ce qui cloche
Modeste
Bonsour® LeSurCitaire :-((( Hélas les Formules de MEFC n'acceptent que les fonctions standards EXCEL ni fonctions complémentaires, ni fonctions Perso ... Désolé !!! -- n'oubliez pas les FAQ : http://www.excelabo.net http://dj.joss.free.fr/faq.htm http://www.faqoe.com http://faqword.free.fr -- Feed Back http://viadresse.com/?94912042
Bonsour® LeSurCitaire
:-(((
Hélas les Formules de MEFC n'acceptent que les fonctions standards EXCEL
ni fonctions complémentaires, ni fonctions Perso ...
Désolé !!!
--
n'oubliez pas les FAQ :
http://www.excelabo.net http://dj.joss.free.fr/faq.htm
http://www.faqoe.com http://faqword.free.fr
--
Feed Back
http://viadresse.com/?94912042
Bonsour® LeSurCitaire :-((( Hélas les Formules de MEFC n'acceptent que les fonctions standards EXCEL ni fonctions complémentaires, ni fonctions Perso ... Désolé !!! -- n'oubliez pas les FAQ : http://www.excelabo.net http://dj.joss.free.fr/faq.htm http://www.faqoe.com http://faqword.free.fr -- Feed Back http://viadresse.com/?94912042
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
"LeSurCitaire" <donzel-gargand.jacques@tiscali.fr> a écrit dans le message
de news: 1125479793.049971.15900@g49g2000cwa.googlegroups.com...
Bonjour,
j'ai trouve cette macro
Function TYPEJOUR(D As Date)
'L. Longre
Dim A As Integer, T As Integer
Dim LP As Date, LD As Long
Dim Toto As Long
A = Year(D)
If A > 2099 Then
TYPEJOUR = CVErr(xlErrValue)
Exit Function
End If
LD = Int(D)
If LD <= 2 Then
If LD = 1 Then TYPEJOUR = 2
Exit Function
End If
T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21
LP = DateSerial(A, 3, 2) + T + (T > 48) _
+ 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7)
Select Case D
' Jours fériés mobiles
Case Is = LP, Is = LP + 38, Is = LP + 49
TYPEJOUR = 2
' Jours fériés fixes
Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _
Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _
Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _
Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25)
TYPEJOUR = 2
Case Else
' Samedi ou dimanche
If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1
End Select
End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je
retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
"LeSurCitaire" a écrit dans le message de news: Bonjour, j'ai trouve cette macro Function TYPEJOUR(D As Date) 'L. Longre Dim A As Integer, T As Integer Dim LP As Date, LD As Long Dim Toto As Long
A = Year(D) If A > 2099 Then TYPEJOUR = CVErr(xlErrValue) Exit Function End If LD = Int(D) If LD <= 2 Then If LD = 1 Then TYPEJOUR = 2 Exit Function End If T = (((255 - 11 * (A Mod 19)) - 21) Mod 30) + 21 LP = DateSerial(A, 3, 2) + T + (T > 48) _ + 6 - ((A + A 4 + T + (T > 48) + 1) Mod 7) Select Case D ' Jours fériés mobiles Case Is = LP, Is = LP + 38, Is = LP + 49 TYPEJOUR = 2 ' Jours fériés fixes Case Is = DateSerial(A, 1, 1), Is = DateSerial(A, 5, 1), _ Is = DateSerial(A, 5, 8), Is = DateSerial(A, 7, 14), _ Is = DateSerial(A, 8, 15), Is = DateSerial(A, 11, 1), _ Is = DateSerial(A, 11, 11), Is = DateSerial(A, 12, 25) TYPEJOUR = 2 Case Else ' Samedi ou dimanche If Weekday(D, vbMonday) >= 6 Then TYPEJOUR = 1 End Select End Function
et quand je rentre dans mFC =TYPEJOUR(B4)=2 cela ne fonctione pas et je retrouve ceci dans la MFC ="=TYPEJOUR(B4)=2"
je ne volis pas ce qui cloche
AV
Hélas les Formules de MEFC .......... , ni fonctions Perso ...
Heu... il me semble que si ! ;-) AV
Hélas les Formules de MEFC ..........
, ni fonctions Perso ...
notamment "Les Jours fériés et WE dans calendrier" dans la rubrique "Date et heures" (sans macro complémentaires ni fonction perso)
AV
Modeste
Houpps !!! Heu... oui.... celles des classeurs ouverts ;o)) des fonctions perso je ne sais même plus dans quel classeur elles se trouvent ;o)))
AV wrote:
Hélas les Formules de MEFC .......... , ni fonctions Perso ...
Heu... il me semble que si ! ;-) AV
-- n'oubliez pas les FAQ : http://www.excelabo.net http://dj.joss.free.fr/faq.htm http://www.faqoe.com http://faqword.free.fr -- Feed Back http://viadresse.com/?94912042
Houpps !!!
Heu... oui....
celles des classeurs ouverts ;o))
des fonctions perso je ne sais même plus dans quel classeur elles se
trouvent ;o)))
AV wrote:
Hélas les Formules de MEFC ..........
, ni fonctions Perso ...
Heu... il me semble que si !
;-)
AV
--
n'oubliez pas les FAQ :
http://www.excelabo.net http://dj.joss.free.fr/faq.htm
http://www.faqoe.com http://faqword.free.fr
--
Feed Back
http://viadresse.com/?94912042
Houpps !!! Heu... oui.... celles des classeurs ouverts ;o)) des fonctions perso je ne sais même plus dans quel classeur elles se trouvent ;o)))
AV wrote:
Hélas les Formules de MEFC .......... , ni fonctions Perso ...
Heu... il me semble que si ! ;-) AV
-- n'oubliez pas les FAQ : http://www.excelabo.net http://dj.joss.free.fr/faq.htm http://www.faqoe.com http://faqword.free.fr -- Feed Back http://viadresse.com/?94912042