Hi Vulpen,
I can't take much credit for this, its something another user produced for a different problem and I adjusted slightly for yours:
Create a macro and put this in the code:
Function aconcat(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant
If TypeOf a Is Range Then
For Each y In a.Cells
aconcat = aconcat & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
aconcat = aconcat & y & sep
Next y
Else
aconcat = aconcat & a & sep
End If
aconcat = Left(aconcat, Len(aconcat) - Len(sep))
End Function
Now on your Output sheet:
Put next to each entry (i.e. 6CAN)
=aconcat(IF(Source1!B1:Source1!B99="6CAN",Source1!I1:Source1!I99,""))
CTRL+SHIFT+ENTER (don't just ENTER)
You can further automate it by say if Output!B6 is 6CAN, put formula in Output!C6 as
=aconcat(IF(Source1!B1:Source1!B99=C6,Source1!I1:Source1!I99,""))
CTRL+SHIFT+ENTER (don't just ENTER)
That way you can copy up/down next to your code column and get all the desired outcomes.
Hope that helps!
-
Remember to mark the thread SOLVED if your problem has been taken care of and to award rep points via the star-like icon
Bookmarks