Using DatePart(interval, date[,firstdayofweek[, firstweekofyear]]) to Parse Dates
Constant Value Year Starts with Week
vbUseSystem 0 Use the system setting.
vbFirstJan1 1 The week in which January 1 falls (the default setting).
vbFirstFourDays 2 The first week with a minimum of four days in the year.
vbFirstFullWeek 3 The first full week (7 days) of the year.
the following statement assigns the current year to the variable dteThisYear:
Sub datePart()
Debug.Print DatePart("yyyy", Date)
End Sub
Related examples in the same category