View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default String separated with commas

Sub dural()
s = "a, b, c, d, e"
s2 = Split(Replace(s, " ", ""), ",")
End Sub

Here s2 is an array. s2(0) will contain "a", etc.
--
Gary''s Student - gsnu200770


"Jarle" wrote:

I have a string looking like:

aaa, bbb, ccc, ddd, eee.....

I want to load an array with these elements - like:

Array(aaa,bbb,ccc,ddd,eee.........).

The elements is separated with comma and space in string.

What is the best way to do this?