WeekNum

Generates the calendar week number for a certain date, counting the first week with four or more days in the new year as week 1
Originally by Mattias Frid
OfDate is the date, if blank it will return week number of today

Function WeekNum(OfDate)
 If OfDate = "" Then OfDate = Date
 WeekNum = DatePart("ww", OfDate, 2, vbFirstFourDays)
End Function

Parameters

OfDate

Views 131 Downloads 56

Perm link