The hour function in VBA returns the hour element for the specified time.

Syntax

Parameter

Time (required) – This parameter represents the time.

Return

This function returns the hour element for the specified time.

Example 1

Output

6

VBA Hour Function

Example 2

Output

22

VBA Hour Function

Example 3

Output

VBA Hour Function

Pin It on Pinterest

Share This