Greetings,
I'm trying to do some string manipulation. I have a string that contains both alpha and numeric data. I want to extract the first number from the string. The number can be anywhere from 4 to 6 digits long so my strategy is to grab everything before the first space.
Ex. "123456 found in WkSht 9999"
I want to extract "123456"
I have the string stored in a variable sVal.
I think it should look something like:
but ofcourse my syntax isn't correct. Need a little assistance.
thanks
I'm trying to do some string manipulation. I have a string that contains both alpha and numeric data. I want to extract the first number from the string. The number can be anywhere from 4 to 6 digits long so my strategy is to grab everything before the first space.
Ex. "123456 found in WkSht 9999"
I want to extract "123456"
I have the string stored in a variable sVal.
I think it should look something like:
Code:
TicketNum = Left(sVal).Value, InStr(1, sVal), " ") - 1)
but ofcourse my syntax isn't correct. Need a little assistance.
thanks