View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Multiple rows into one

How about posting a sample layout. Here is one I did a couple of days ago
where names in col a and data in col c. Put unique names in col D and string
in col E and sum in col F

Sub getscroresinonecell()
'get unique names for list
lr = Cells(Rows.Count, "a").End(xlUp).Row
Range(Cells(1, "d"), Cells(lr, "e")).ClearContents
Range("A1:A" & lr).AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("D1"), Unique:=True
'find scores for each
dlr = Cells(Rows.Count, "d").End(xlUp).Row
For Each x In Range("d2:d" & dlr)
ms = ""
mss = 0
With Range("a1:a" & lr)
Set c = .Find(x)
If Not c Is Nothing Then
firstAddress = c.Address
Do
ms = ms & "," & c.Offset(, 2)
mss = mss + c.Offset(, 2)

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
Cells(x.Row, 5) = Right(ms, Len(ms) - 1)
Cells(x.Row, 6) = mss
Next
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MarkP" wrote in message
...
I have an app. that can be used to generate an output file containing user
data. It is a five column file, with the first two columns containing
identical data for each user; specifically user-id and user name. The
remaining three columns contain unique data. For each occurrence of
unique
data for a particular user, a new row is generated.

Is there a way to combine the multiple rows for a user into one row?