0

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.

2 Answers 2

2

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, ">")
Sign up to request clarification or add additional context in comments.

1 Comment

This is VB, not VBA (which doesn't allow the assignment in the declaration)
1

this code will solve your problem

Dim longString as String
longString = "word1>longword2>longerword3>word4>anotherword5>"

Dim arrayString() as String
arrayString = Split(longString, ">")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.