Left() - A portion of a string beginning from the left side : Left « String Functions « VBA / Excel / Access / Word






Left() - A portion of a string beginning from the left side

 
Sub InstrLeft()
    Dim userName As String
    Dim firstName As String
    Dim spaceLoc As Integer

    userName = "First Last"
    spaceLoc = InStr(1, userName, " ")
    firstName = Left(userName, spaceLoc - 1)

    Debug.Print firstName
End Sub

 








Related examples in the same category

1.Left() Returns a substring from the left side of a string.