SPACE(number)

Returns the specified number of spaces (String).


numberThe number of spaces you want in the text string.

REMARKS
* This function is useful for formatting output and clearing data in fixed-lengths strings.
* You can use the SPACE$ function to return a String data type instead of a Variant/String data type.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.Space
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print Space(10)        '= "          "  
Debug.Print Space(-1) '- runtime error
Debug.Print Space("text") '- runtime error

Dim sText As String
sText = " ' " & Space(10) & " ' "
Debug.Print sText

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top