If you are looking for the opposite to get a date from a weeknumber i found a solution online and changed it slightly:
Function fnDateFromWeek(iYear As Integer, iWeek As Integer, iWeekDday As Integer)
' get the date from a certain day in a certain week in a certain year
fnDateFromWeek = DateSerial(iYear, 1, (iWeek * 7) _
+ iWeekDday - Weekday(DateSerial(iYear, 1, 1)) + 1)
End Function
I took the formular from asap-utilities.com/ and changed
DateSerial(iYear, 1, ((iWeek - 1) * 7)
to
DateSerial(iYear, 1, (iWeek * 7)
Update
It seems that at least for germany the formular works not as expected for the leap year 2016 so i changed it to this
Function fnDateFromWeek(iYear As Integer, iWeek As Integer, iWeekDday As Integer)
' get the date from a certain day in a certain week in a certain year
If isLeapYear(iYear) Then
curDate = DateSerial(iYear, 1, ((iWeek) * 7) _
+ iWeekDday - Weekday(DateSerial(iYear, 1, 1)) + 1)
Else
curDate = DateSerial(iYear, 1, ((iWeek - 1) * 7) _
+ iWeekDday - Weekday(DateSerial(iYear, 1, 1)) + 1)
End If
fnDateFromWeek = curDate
End Function
Since 2016 hardcoded is not ideal you could check if a year is a leap year with this function
Function isLeapYear(iYear As Integer) As Boolean
If (Month(DateSerial(iYear, 2, 29)) = 2) Then
isLeapYear = True
Else
isLeapYear = False
End If
End Function
For a non-leap-year DateSerial(iYear,2 ,29)
returns 1st of march
This may still be wrong but my limited test gave the expected results:
Sub TestExample()
Debug.Print Format(fnDateFromWeek(2014, 48, 2), "ddd dd mmm yyyy") ' mo 24 Nov 2014
Debug.Print Format(fnDateFromWeek(2015, 11, 6), "ddd dd-mmm-yyyy") ' fr 13 Mar 2015
Debug.Print Format(fnDateFromWeek(2016, 36, 2), "ddd dd-mmm-yyyy") ' Mo 05 Sep 2015
End Sub