[quote=200272:@Beatrix Willius]Or can your description contain spaces? Are your keywords (quantity etc) always the same? Can the value of the description contain a keyword or a “:”?
I’d split by space. Then loop through the resulting array. If you find a keyword ending with a “:” then you know that the next entry contains a value.
HTH[/quote]
No, the values always change, So I think about the description contains spaces and If I split by spaces, it will split in many many pieces. So I thought to put commas and split by commas.
Like this:
Concept = “Quantity: 1, Measurement Unit: PIECE, Descriptión: FH-8M FLEXOMETER, UnitPrice: 128.21, TotalPrice: 128.21”
Dim anArray(-1) as String
anArray=Concept.Split(",")
r.CellText(r.LastIndex, 0) = anArray(0)
r.CellText(r.LastIndex, 1) = anArray(1)
r.CellText(r.LastIndex, 2) = anArray(2)
r.CellText(r.LastIndex, 3) = anArray(3)
r.CellText(r.LastIndex, 4) = anArray(4)
Now I get splited in four pieces, Its fine. Now I need to trim the labels: Quantity, Measurement Unit, UnitPrice and blah blah blah
Now I’m thinking to use LEFT to trim the text.
And As I say in the String repeats the values as many Items has inside.
So I dunno If a loop will be a good idea, the issue is how to know, where to stop.
Cuz Sometimes will have 1 items, sometimes 50, sometimes 80, sometimes 18, etc.