View Single Post
  #4   Report Post  
duane
 
Posts: n/a
Default If True Concatenation


this should do it i think - note where i wrote the results

Sub Macro1()
Dim istring As String
'Assume first name is in cell F2 and contiguous to the right
ecol = Cells(2, 6).End(xlToRight).Column
' 300 rows of x's starting in row 3
For k = 3 To 303
istring = ""
j = 0
For i = 6 To ecol
If Cells(k, i).Value < "x" Then GoTo nexti
j = j + 1
If j = 1 Then istring = Cells(2, i).Value Else _
istring = istring & "," & " " & Cells(2, i).Value
nexti:
Next i
'
'I write the result to column e of each row - change if you need to
'
Cells(k, 5).Value = istring
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=480747