Be the first user to complete this post

  • 0
Add to List

VBA-Excel : Strings Functions – Right

Description: 

Returns a string containing number of characters specified by the user, starting from right side of the input string.

Format:

Right(strMainString,intLength)

Arguments:
  • strMainString
    • Mandatory
    • Type: String
    • String whose characters to be returned.

  • intLength
    • Mandatory
    • Type: Numeric
    • Number of characters to be returned.
    • If number specified is greater than the string length then entire string is returned.
Function FnRight()

   Dim mainString

   mainString = "SumitJain"

   intLngth = 5

   MsgBox "The first " & intLength & " characters from Right are ' " & Right(mainString, intLngth) & " '"    

End Function 
Right()
Right()

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 : Strings Functions – Instr
  2. VBA-Excel: Delete Blank Rows from Excel Work Sheet
  3. VBA-Excel : Strings Functions – InstrRev
  4. VBA-Excel: Date-Time Functions – DateAdd()
  5. VBA-Excel: Date-Time Functions – CDate()