hi guys i have written a small program to receive data from a cash reg printer everything works fine but(yes theres always a but) the data from the till output is in compleat string ie bread 0.67 what i want to do is extract the last text on right and store it to excell and the first piece of text and store it in a different cell my problem is i dont know how to splilt the string into 2 .

thankyou

Recommended Answers

All 2 Replies

You could use the Split funtion, but that wouldn't work well if your string contains more than one space, for example "white bread 0.67" If the price is always the last part of the string, why not create a function that starts at the end and finds the last space?

dim x as string
x = "white bread 0.67"
parts = split(x, " ")
xCost = parts(ubound(parts()))
' // ;-)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.