Separate Text from a textbox

I am reading a bardcode into a txtInput.text, which contains a text like this 01605181524 2010
I want to trim the first 5 characters then take from 6 to 11 into txtbatchid.text   then the rest into txtweight
Who is Participating?
FER_GConnect With a Mentor Commented:
teogos; i don't know if the results ar OK, but you can change the numbers of Start and Length, and you'll get the values that you are expecting.

bardcode = "01605181524 2010"
txtbatchid.text  =  mid(bardcode,6,6) 'you'll get 181524
txtweight.text = mid(bardcode,12)  'you'll get 2010

Ing. Fernando D. Giletta
San Francisco. Córdoba. Argentina.
teogosAuthor Commented:
Seem to work, but there is one more thing that I forget, at the end of txtweight 2010 there is a CR how can I get rid off of this CR to display clean 2010
ALaRivaConnect With a Mentor Commented:
txtweight.text = Replace(mid(bardcode,12) ,VbCr,"")
teogosAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.