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 can be used in VBA or in an SQL query.

Examples

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 © 1999-2024 SS64.com
Some rights reserved