Excel VBA: Split Method

Converemon

New Member
Joined
May 23, 2014
Messages
15
I have just recently discovered the "Split" function and found it very useful for a project I am working on. I am parsing a string in the form of "M71+L09+J82+K99..." with "+" as the delimiter. However, when I try to parse the string into an array it only grabs the strings after the "+" which results it skipping the first one ("M71"). I was wondering if anyone had to deal with this problem before? Here is my code:

Code:
opcArray() = Split(curoptlistcell.Value, "+")
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
However, when I try to parse the string into an array it only grabs the strings after the "+" which results it skipping the first one ("M71").
How are you trying to return it?
Note, that by default, arrays are zero indexed, meaning that you would return the first item like this:
Code:
opcArray(0)
not like this:
Code:
opcArray(1)
(that would return the second member of the array)
 
Upvote 0
Upvote 0
I would like to apologize. I posted this thread before I asked on my other thread. I figured I'd ask since I had not yet received any answers. My apologies.
 
Upvote 0
I would like to apologize. I posted this thread before I asked on my other thread. I figured I'd ask since I had not yet received any answers. My apologies.
You should just "bump" your original thread instead of starting a new one, but if you do start a new thread, then you should go back to your original thread and post a message there saying you started a new thread and give the link to it, that way volunteers in this forum won't waste their time answering your old thread (assuming they stumble across it) when you already have your answer elsewhere.
 
Upvote 0

Forum statistics

Threads
1,215,364
Messages
6,124,510
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top