Excel VBA Year Function: The Year function in VBA returns the four-digit year for the specified date.

Syntax

Parameter

Date (required) – This parameter represents the significant date.

Return

This function returns the four-digit year for the specified date.

Example 1

Output

2020

VBA Year Function

Example 2

Output

2020

VBA Year Function

Example 3

Output

1899

VBA Year Function

Pin It on Pinterest

Share This