Extract a substring from a string, starting from the left-most character.

      Left(string, NumberOfCharacters)

   string              A string or string expression.

   NumberOfCharacters  The Number of characters to return

The Left() function can be used in VBA or in an SQL query.

Left() will return a Variant, you can also use Left$() to return a String.
You should use Left() if there is any chance of a Null value, since assigning Null to a String will raise an error.

Use the LeftB function with byte data contained in a string. Instead of specifying the number of characters to return, length specifies the number of bytes.


Dim strDemo as String
strDemo = Left("The world is everlasting", 9 )
Msgbox strDemo
Returns "The world"

“Begin at the beginning, the King said, very gravely, and go on till you come to the end: then stop” ~ Lewis Carroll


Mid - Extract a substring from a string
Right - Extract a substring from a string

© Copyright SS64.com 1999-2016
Some rights reserved