The VBA LEFT Function returns the specified number of characters of a string from the left.
Left(text, number_characters)
Retrieve a variable number of characters from the same string from the left:
Sub LeftExample() MsgBox Left("www.moonexcel.com.ua", 1) 'Returns: w MsgBox Left("www.moonexcel.com.ua", 2) 'Returns: ww MsgBox Left("www.moonexcel.com.ua", 3) 'Returns: www MsgBox Left("www.moonexcel.com.ua", 4) 'Returns: www. MsgBox Left("www.moonexcel.com.ua", 5) 'Returns: www.m MsgBox Left("www.moonexcel.com.ua", 10) 'Returns: www.moonex MsgBox Left("www.moonexcel.com.ua", 50) 'Returns: www.moonexcel.com.ua End Sub