Remove and Add Text to Numbers
for VBA
MyString
VAL(mid(MyString,2,Instr(MyStr," ")-1))
Just to point out to the OP... I'm guessing you meant to write MyString
whereas you wrote MyStr instead.
By the way, here is another what to get the number out in VBA...
--Mid(Split(MyString)(0),2)
Although if the "code number" in the front is always constructed as shown,
you could get the number portion directly....
--Mid(MyString,2,5)
Rick
|