There are multiple ways of parsing so here one:
VB Code:
Private Sub Command1_Click() Dim sText As String Dim res1$, res2$ sText = "123456 - Popo" res1 = Trim(Left(sText, InStr(1, sText, "-") - 1)) res2 = Trim(Mid(sText, InStr(1, sText, "-") + 1)) Debug.Print res1 Debug.Print res2 End Sub




Reply With Quote