une petite recherche dans google et voila :
http://www.cpearson.com/excel/DateTimeVBA.htm
Monday Of A Given Week Number (WeekStart)
This function returns the date of the Monday in a given week number, e.g., the Monday of the 15th week of 1998. It requires the YearStart function, given above.
Public Function WeekStart(WhichWeek As Integer, WhichYear As _
Integer) As Date
WeekStart = YearStart(WhichYear) + ((WhichWeek - 1) * 7)
End Function
First Monday Of The Year (YearStart)
The following function was provided by John Green, an Excel MVP from Australia. It returns the first Monday of the specified year. This function is used by other functions on this page.
Public Function YearStart(WhichYear As Integer) As Date
Dim WeekDay As Integer
Dim NewYear As Date
NewYear = DateSerial(WhichYear, 1, 1)
WeekDay = (NewYear - 2) Mod 7 'Generate weekday index where Monday = 0
If WeekDay < 4 Then
YearStart = NewYear - WeekDay
Else
YearStart = NewYear - WeekDay + 7
End If
End Function
Message édité par friday_13 le 26-08-2005 à 11:26:06