2

I am right now trying something like this

Dim myAddress() As String
myAddress= Split("4th Street NW Washington, DC")

For intI = 1 To UBound(myAddress)
     `how can i access myAddress[intI+1] from here?
Next intI

1 Answer 1

5

Try this:

Dim myAddress() As String
myAddress= Split("4th Street NW Washington, DC")

For intI = 1 To UBound(myAddress)
    Console.WriteLine(myAddress(intI))
Next intI
Sign up to request clarification or add additional context in comments.

4 Comments

thanks that does work the problem within that loop how would i access the +1 or next element
VBA defaults to 0 as the index of the first array element.
awesome! so I can do myAddress(intI+1)? is there a way to check if it's a valid index?
Valid index values are >= LBound(myAddress) And <= UBound(myAddress)

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.