Val

Extract a numeric value from a string.

Syntax
      Val ( String )

Key
   String   A string expression.

Val() will stop reading the string at the first non-numeric character. This does not include spaces.

The Val() function may be used in VBA or in an SQL query.

Example

Dim intHouseNo as Integer
intHouseNo = Val ("12 Acacia Gardens")
returns: 12

“A worker may be the hammer's master, but the hammer still prevails. A tool knows exactly how it is meant to be handled, while the user of the tool can only have an approximate idea” ~ Milan Kundera

Related:

Mid - Extract a substring from a string.


© Copyright SS64.com 1999-2013
Some rights reserved