Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

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
0
teogos
Asked:
teogos
  • 2
2 Solutions
 
FER_GCommented:
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

FerG
Saludos.
--
Ing. Fernando D. Giletta
San Francisco. Córdoba. Argentina.
0
 
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
0
 
ALaRivaCommented:
txtweight.text = Replace(mid(bardcode,12) ,VbCr,"")
0
 
teogosAuthor Commented:
Thanks
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now