Function getString(v As String) As String
v = UCase(v)
For i = 1 To Len(v)
If Asc(Mid(v, i, 1)) >= 65 And Asc(Mid(v, i, 1)) <= 90 Then
getString = getString & Mid(v, i, 1)
Else
getString = getString & Mid(v, i, 1)
Exit Function
End If
Next
End Function
=getString(A2)
Function getString(ByVal str As String) As String
Dim i As Integer
Dim resStr As String
For i = 1 To Len(str)
If IsNumeric(Mid(str, i, 1)) Then
resStr = resStr & Mid(str, i, 1)
getString = resStr
Exit Function
Else
resStr = resStr & Mid(str, i, 1)
End If
Next i
End Function
Then if your string is in A2, try this...=getString(A2)
=LEFT(A2,SEARCH(RIGHT(A2,LEN(A2)-MIN(FIND(0,SUBSTITUTE(A2,{1,2,3,4,5,6,7,8,9},0)&0))+1),A2))
I have no idea where to put that function code - I only how to add copy and paste the formulayou can create a Module and paste the codes there.
Open in new window
where A2 = ABRAME124001
else we should write a custom function to achieve this, but you got to tell us more details about your value.