Space

Return a number of spaces.

Syntax
      Space(Number)

Key
   Number  The number of spaces to return.

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

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

Example

Dim strDemo as String
strDemo = Space(5)

'Returns: "     "

“Empty pockets never held anyone back. Only empty heads and empty hearts can do that” ~ Norman Vincent Peale

Related:

RTrim - Remove trailing spaces from a string.


© Copyright SS64.com 1999-2016
Some rights reserved