I have this formula (below) where I am trying to find a space in C1. Instead of this, I would like to update this formula to look for anything except for "C" or any number and not only find a space.
LEFT(C1, find("" "", C1, 1)-1)
For e.g. if C1 has - "C1234 - XXX" or "C1234-XXX" or "C1234:XXX", I always want the above function to find anything except for "C" and "1234" (i.e. numbers).
P.S.: I would want to use the find function only with improvements to meet the above conditions.
I would not use formulas in vba unless absolutely necessary:
Sub getstring() Dim t As String t = "C1234 - XXX" Dim i As Long For i = Len(t) To 1 Step -1 Dim lc As String If InStr("1234567890", Mid(t, i, 1)) > 0 Then lc = Left(t, i) Exit For End If Next i Debug.Print lc End Sub