View Single Post
  #5   Report Post  
duane
 
Posts: n/a
Default


You are quite welcome. This version has some minor improvements.

Sub Macro1()
'Sheet1 has the raw, unconcatenated data
'Sheet2 gets the concatenated data
'istring(i) are the concatenated strings
Sheets("sheet1").Select
Dim istring(20) As String
erow = 0
i = 1
start:
erow = erow + 1
Set rng = Sheets("sheet1").Range(Cells(erow, 1), Cells(1000,
1)).Find("For Example:")
If rng Is Nothing Then GoTo done
irow = rng.Row
erow = Cells(irow, 1).End(xlDown).Row
istring(i) = ""
For j = irow To erow
If j = irow Then istring(i) = Cells(j, 1).Value Else _
istring(i) = istring(i) & " " & Cells(j, 1).Value
Next j
i = i + 1
GoTo start
done:
Sheets("sheet2").Select
Cells(1, 1) = "Example"
For k = 1 To i - 1
Cells(k + 1, 1) = istring(k)
Next k
End Sub


--
duane


------------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=374110