Link to home
Start Free TrialLog in
Avatar of Roger
RogerFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Writing a , - delimited, or ; - delimited string to an array

Hi, I have shapesheet cells with data strings like this:
1,234,34,236,45,863,5,1,89 or like this: 1;644;34;26;45;92871;89
(the type of delimiter is not constrained; white space can be added; the data is integer).

I want to compare strings and identify those with AT LEAST ONE integer in common. The relative positions of integers within the strings are irrelevant.

- Should I should first convert the shapesheet data strings to arrays, and then compare them?
- If so, what is the simplest way of converting a string from a shapesheet cell into a VBA array?
- Are there comparision functions that are useful for this task?

(My home made string parser enumerate integers individually, but it has given me problems when I seek to output the enumerated data in the form of an array. I suspect a ReDim problem, but want to ask about best approaches before further attempts to pep-up my code..)

I use vba, not VB.

Thanks,
Kelvin
ASKER CERTIFIED SOLUTION
Avatar of Arno Koster
Arno Koster
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roger

ASKER

Hi  Akoster,
Many thanks for the instant response: it worked first time.

Best regards
Kelvin
excellent !