Next function was available with John Green, a be noticed MVP out of Australia. They efficiency the original few days number of the specified season. It entails the new YearStart setting, considering prior to.
Public Function ISOWeekNum(AnyDate As Date, Optional WhichFormat As Variant) As Integer ‘ WhichFormat: missing or <> 2 then returns week number, ‘ = 2 then YYWW ‘ Dim ThisYear As Integer Dim PreviousYearStart As Date Dim ThisYearStart As Date Dim NextYearStart As Date Dim YearNum As Integer
ThisYear = Year(AnyDate) ThisYearStart = YearStart(ThisYear) PreviousYearStart = YearStart(ThisYear – 1) NextYearStart = YearStart(ThisYear + 1) Come across Circumstances AnyDate Instance Was >= NextYearStart ISOWeekNum = (AnyDate – NextYearStart) \ 7 + 1 YearNum = Year(AnyDate) + step 1 Situation Was
There
must be a space following very first fist to your cuatro and you may 5 finger serial quantity, and no area to your six finger wide variety
Setting Years(Date1 As the Date, Date2 Because the Big date) Since the Sequence Dim Y Because the Integer Dim Yards Just like the Integer Dim D While the Integer Dark Temp1 Since the Go out Temp1 = DateSerial(Year(Date2), Month(Date1), Day(Date1)) Y = Year(Date2) – Year(Date1) + (Temp1 > Date2) Yards = Month(Date2) – Month(Date1) – (twelve * (Temp1 > Date2)) D = Day(Date2) – Day(Date1) When the D