Hey, guys
I'm having a VBA exam next Monday and I want to be as prepared as I can. In class, my teacher taught us how to get a msg box with first name and last name but we didn't learn how to extract middle names. I tried to ask him how to do so but he wasn't quite explanatory.
In class what we've learn was
I was wondering if there's any way to present the middle name to the user - and, if so, how.
Let's say the user types "Wayna Nanook Aputsiaq Nanuk Berg" and I want to extract:
1) "Aputsiaq"
2) "Nanook"
Thanks,
ORoxo
I'm having a VBA exam next Monday and I want to be as prepared as I can. In class, my teacher taught us how to get a msg box with first name and last name but we didn't learn how to extract middle names. I tried to ask him how to do so but he wasn't quite explanatory.
In class what we've learn was
Code:
Private Sub CommandButton8_Click()
Dim T As String, FN As String, LN As String
T = InputBox("Please type your full name")
FN = MsgBox("Your first name is " & Left(T, InStr(T, " ")))
LN = MsgBox("Your last name is " & Right(T, Len(T) - InStrRev(T, " ")))
End Sub
I was wondering if there's any way to present the middle name to the user - and, if so, how.
Let's say the user types "Wayna Nanook Aputsiaq Nanuk Berg" and I want to extract:
1) "Aputsiaq"
2) "Nanook"
Thanks,
ORoxo
Last edited: