Year Function

Devolve o ano dun valor de data en serie xerado pola función DateSerial ou DateValue.

Sintaxe:

Year (Número)

Valor de retorno:

Enteiro

Parámetros:

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

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))

devolve o valor 1994.

Códigos de erro

5 Chamada de procedemento incorrecta

Exemplo:

Sub ExampleYear

    MsgBox "" & Year(Now) ,64,"Ano actual"

End Sub