VBA – Space String
The Space() function in VBA is used to generate a string consisting of a specified number of spaces.
Space()
Syntax:
Space(number)
Parameter:
Return Value:
Example
Dim str1 As String Dim str2 As String str1 = Space(5) ' str1 will be " " (five spaces) str2 = Space(0) ' str2 will be an empty string ("")
Use Cases: