VBA Hex Function: The Hex function in VBA converts the given number into hexadecimal notation and returns the result as a string.

Syntax

Parameter

Number (required) – This parameter represents the numeric value that you want to convert to hexadecimal.

Return

This function returns a string value after converting the specified number into hexadecimal notation. If the number is a decimal, it will round it to the nearest integer before converting it to hexadecimal.

Example 1

Output

F

VBA Hex Function

Example 2

Output

7D0

VBA Hex Function

Example 3

Output

5.00E+09

VBA Hex Function

Pin It on Pinterest

Share This