View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1987_] Rick Rothstein \(MVP - VB\)[_1987_] is offline
external usenet poster
 
Posts: 1
Default looping through comma delimited text

Consider this...

Dim X As Long
Dim BlockOfText As String
Dim Fields() As String
BlockOfText = "text1, text2, text3, etc."
' The next statement assumes a comma followed
' by a space, as shown, is the delimiting the text
Fields = Split(BlockOfText, ", ")
' The zero-based Fields array now holds
' each text sub-string in its elements...
For X = 0 To UBound(Fields)
Debug.Print Fields(X)
Next

Rick


"DZ" wrote in message
...
Hi

I need to do something with a comma delimited block of text.

....like
text , text, text, etc

Can someone help me write a loop to loop through each block of text
between
commas?

Thanks alot for any help