72eDH‖

9HGdK‖Year Function

My6Uq‖Returns the year from a serial date number that is generated by the DateSerial or the DateValue function.

dgHna‖Syntax:


Dv5jP‖Year (Number)

ZGf4A‖Return value:

B5gnw‖Integer

E3cZS‖Parameters:

93kLy‖Number: Integer expression that contains the serial date number that is used to calculate the year.

iJ8tY‖This function is the opposite of the DateSerial function, and returns the year of a serial date. For example, the expression:


Print Year(DateSerial(1994, 12, 20))

Ft597‖returns the value 1994.

SEjHR‖Error codes:

5 Invalid procedure call

Ms2Zi‖Example:


Sub ExampleYear
szhaC‖    MsgBox "" & Year(Now) ,64,"Current year"
End Sub