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