Function MoisNum(strLeMois As String) As Integer
MoisNum = Month(CDate("1 " & strLeMois & " " & Year(Date)))
End Function
Function MoisNum2(ByVal strLeMois As String) As Integer
strLeMois = LCase(strLeMois)
MoisNum2 = Switch(strLeMois = "jan", 1, strLeMois = "fév", 2, strLeMois = "mars", 3, strLeMois = "avr", 4, strLeMois = "mai", 5, _
strLeMois = "juin", 6, strLeMois = "juil", 7, strLeMois = "août", 8, strLeMois = "sept", 9, strLeMois = "oct", 10, strLeMois = "nov", 11, strLeMois = "déc", 12)
End Function
Sub testmois()
moiatbrut = [D4]
MoisNum2 (moiatbrut)
End Sub
Function MoisNum2(ByVal moiatbrut As String) As Integer
moiatbrut = LCase(moiatbrut)
MoisNum2 = Switch(moiatbrut = "jan", 1, moiatbrut = "fév", 2, moiatbrut = "mar", 3, moiatbrut = "avr", 4, moiatbrut = "mai", 5, _
moiatbrut = "juin", 6, moiatbrut = "juil", 7, moiatbrut = "août", 8, moiatbrut = "sept", 9, moiatbrut = "oct", 10, moiatbrut = "nov", 11, moiatbrut = "déc", 12)
End Function
Function NumMois(x)
'retourne zéro si pas dans liste
NumMois = (InStr(",jan,fév,mar,avr,mai,jun,jui,aoû,sep,oct,nov,déc," _
, "," & x & ",") + 3) \ 4
End Function
Function moisalpha(m) As String
moisalpha = Left(Format(DateValue("1/" & m), "mmm"), 3)
End Function
Sub a()
MsgBox moisalpha(1)
End Sub
Sub TableauFixe()
Dim m
m = Application.Match([D4], Array("jan", "fev", "mar", "avr", "mai", "jun", "jui", "aoû", "sep", "oct", "nov", "dec"), 0)
If IsNumeric(m) Then MsgBox m
End Sub
Function MonMois(t$)
MonMois = Application.Match(t, Array("jan", "fev", "mar", "avr", "mai", "jun", "jui", "aoû", "sep", "oct", "nov", "dec"), 0)
MonMois = IIf(IsNumeric(MonMois), MonMois, "")
End Function
Sub TableauFixe()
Dim m
m = Replace(Replace([D4].Text, "é", "e"), "û", "u")
m = Application.Match(m, Array("jan", "fev", "mar", "avr", "mai", "jun", "jui", "aou", "sep", "oct", "nov", "dec"), 0)
If IsNumeric(m) Then MsgBox m
End Sub
Function MonMois(t$)
t = Replace(Replace(t, "é", "e"), "û", "u")
MonMois = Application.Match(t, Array("jan", "fev", "mar", "avr", "mai", "jun", "jui", "aou", "sep", "oct", "nov", "dec"), 0)
MonMois = IIf(IsNumeric(MonMois), MonMois, "")
End Function
t = Replace(Replace(t, "é", "e"), "û", "u")
t = Left(LCase(t), 3)
sourceJours de la semaine et mois de l'année
À l'inverse des règles typographiques utilisées en anglais, les noms de jours ou de mois ne prennent pas de majuscule en français.
Le mardi 25 décembre.
Le krach du 24 octobre 1929 est appelé le jeudi noir.
Le dimanche de la Toussaint, le lundi de Pâques et le Vendredi saint (notez la majuscule dans ce dernier exemple, en accord avec la règle typographique pour les fêtes religieuses).