Reputation: 1827
I have a string in this format:
>word1>longword2>longerword3>word4>anotherword5>
In VBA I am looking to extract all words between the characters >
. Any guidelines will be much appreciated - words contain numbers and special characters and are not fixed in length.
Upvotes: 0
Views: 10052
Reputation: 103
Use the split function : http://msdn.microsoft.com/library/6x627e5f(v=vs.90).aspx
There is an example at the end of the link.
You need to use something like:
Dim TestArray() As String;
TestArray = Split(myString, ">")
Upvotes: 2
Reputation: 1211
this code will solve your problem
Dim longString as String
longString = "word1>longword2>longerword3>word4>anotherword5>"
Dim arrayString() as String
arrayString = Split(longString, ">")
Upvotes: 1