VBA Val Function: The Val function in VBA converts the given string into a numeric value. This function ignores spaces and continues to read the characters after space(s). It stops reading the String if the numbers include currency symbols, the % symbol and commas.

Syntax

Parameter

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

Return

This function returns a numeric value after converting the specified string into numeric.

Example 1

Output

500

Example 2

Output

11.5

VBA Val Function

Example 3

Output

11.511

VBA Val Function

Example 4

Output

15

VBA Val Function

Pin It on Pinterest

Share This