Be the first user to complete this post

  • 0
Add to List

VBA-Excel: String Functions – Space()

Description: 

The Space() function returns a string consisting a specified number of spaces.

Format:

Space (intNumberOfSpaces)

Arguments:
  • intNumberOfSpaces
    • Mandatory
    • Type: Numeric
    • Number of spaces you want in the string.

Function FnSpace()

   intNos = 25

   MsgBox "Perfect example of" & Space(intNos) & "Space"

End Function
Space()
Space()

Also Read About  Other String() Functions

INSTR()                       |                         InstrREV()                       |                        LCase()

UCase()                      |                         Left()                                |                        Right()

LTrim()                        |                         Mid()                                 |                        Trim()

RTrim()                       |                        Replace()                          |                        Space()

Len()                           |                        StrComp()                         |                        String()



Also Read:

  1. VBA Excel - Cells, Ranges and Offset : Cells
  2. VBA-Excel: String Functions – Mid()
  3. VBA-Excel: Date-Time Functions – DateAdd()
  4. VBA Excel – Refer to Multiple Ranges : Union Method
  5. VBA-Excel: Delete Blank Rows from Excel Work Sheet
  6. VBA-Excel: String Functions – strComp()
  7. VBA-Excel: String Functions – Len()
  8. VBA-Excel: String Functions – RTrim()