Hello
4718800 GLV ZAM 1.6mm(16Ga)PLT 11H8376M5PZ
This is what my material name looks like, I want to extract the first "4718800" and the last "11H8376M5PZ"
I want to know how to write my code so that it reads the name from the left and right up until there is a space. "4718800" should then be populated in the iProperties under "Custom" tab and "AREA". and the "11H8376M5PZ" to be populated under the iProperties "Project" , "Stock Number"
I can do a code that counts a number of spaces and the uses that but, I would like it to read just till space and the use that as not all of the names are the same lengths.
Can anyone help me, please?
Solved! Go to Solution.
Solved by dean.morrison. Go to Solution.
Hi,
You could use split to do it, but the number of parts must be the same - in your case below it would be 5.
If you can count the number of spaces, i'm sure you could modify it so it works if the number is different.
Anyway it goes like this..
MatSplit = Split(MaterialName, " ")
For i = 0 To UBound(MatSplit)
Part1 = MatSplit(0)
Part2 = MatSplit(1)
Part3 = MatSplit(2)
Part4 = MatSplit(3)
Part5 = MatSplit(4)
Next
I hope that helps you.
Dean.
Can't find what you're looking for? Ask the community or share your knowledge.