VBA-Excel: String Functions – String()

VBA-Excel: String Functions – String()

Description:

 The String() func­tion returns a string con­sist­ing a repeat­ing char­ac­ters of spec­i­fied length.

Format:

String(number,character)

Arguments:
  • num­ber
    • Manda­tory
    • Type: Numeric
    • No of times the char­ac­ter to be repeated, means length of the returned string.

  • Char­ac­ter
    • Manda­tory
    • Type: Numeric
    • Char­ac­ter to be repeated
Function FnString()

  intNumber = 10

  strChar = "S"

  MsgBox String(intNumber, strChar)

End Function     
String()

String()

Also Read About  Other String() Functions

INSTR()                       |                         Instr­REV()                       |                        LCase()

UCase()                      |                         Left()                                |                        Right()

LTrim()                        |                         Mid()                                 |                        Trim()

RTrim()                       |                        Replace()                          |                        Space()

Len()                           |                        Str­Comp()                         |                        String()

 

Happy Macro­ing :)

Sumit Jain

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

%d bloggers like this: