Filling Arrays (1 Viewer)

ayeshamiah

Registered User.
Local time
Today, 18:38
Joined
May 24, 2000
Messages
20
Hi all,
I have a string variable which goes something like this

"1,4,13,15,19,23,29"

I would like to fill an array with the values seperated by the commas. The glitch is how do chop the string and subsequently fill the array.

VBA Solutions please

Thanks in advance, Ayesha
 

KDg

Registered User.
Local time
Today, 18:38
Joined
Oct 28, 1999
Messages
181
Hi Ayesha,

you should be able to use Instr(), mixed with left,mid or right to read out what you need in any order. For example. Starting at the left use instr to find the first comma, once you've found it read everything to the left of it into your array. Either truncate the string to remove up to and including the first comma ( using mid or right ) or start reading again from the space after the first comma. and so on, just loop to the end and you should be fine

HTH

Drew
 

ayeshamiah

Registered User.
Local time
Today, 18:38
Joined
May 24, 2000
Messages
20
Many thanks Drew
 

Users who are viewing this thread

Top Bottom