String separated with commas
Sub dural()
s = "a, b, c, d, e"
s2 = Split(Replace(s, " ", ""), ",")
End Sub
You do not have to use the replace function to pare down the delimiter to a
single character like that... the delimiter can contain multiple
characters...
s2 = Split(s, ", ")
where the characters between the quote marks are a comma followed by a
space. Now, with that said, doing what you posted will protect against a
improperly formed string of text where the number of spaces following the
comma are not consistent throughout the text.
Rick
|