Hello!
I want to make a code that allows the user to enter week number (and year), the code should then generate the start- and enddate of this week.
(it's the functions, not the dialogboxes I'm looking for).
Thx in advance!
Hello!
I want to make a code that allows the user to enter week number (and year), the code should then generate the start- and enddate of this week.
(it's the functions, not the dialogboxes I'm looking for).
Thx in advance!
How are your week numbers defined, are they ISO week numbers?
No, just weeknumber (e.g. 41 this week) and year. That should be sufficient to determine startdate (monday Oct. 8) and enddate (sunday Oct. 14)...? (It's sure is, if you have an old almanac... )Originally Posted by daddylonglegs
OK, I ask because Excel has a WEEKNUM function which gives different results to the standard ISO week numbers used in Europe. With ISO week numbers week 1 starts on the first Monday on or after 29th December.
Sorry, you probably want VBA but you can get the start date with a formula like this
=DATE(B1,1,A1*7-2)-WEEKDAY(DATE(B1,1,3))
where B1 contains the year and A1 the week number
to get the end date just add 6 to the start date
Thank You very much, daddylonglegs! Your solution works perfect!
Best regards
Georg Rokne
Last edited by gerok; 10-09-2007 at 02:13 AM. Reason: spelling
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks