sorting data
hi
not with the standard excel sort. what you want would require consolidating
data and deleteing row. that would require a macro.
the below macro works on your sample data. backup your data before runing
the macro.
Sub shiftup()
Dim r As Range
Dim ro As Range
Set r = Range("A2")
Do While Not IsEmpty(r)
Set ro = r.Offset(1, 0)
If r.Value = ro.Value Then
r.Offset(0, 1).Value = r.Offset(0, 1).Value &", " & r.Offset(1, 1).Value
r.Offset(1, 0).EntireRow.Delete shift:=xlUp
Set ro = r.Offset(1, 0)
Else
Set r = ro
End If
Loop
End Sub
regards
FSt1
"kokhong" wrote:
is there any way to sort my data in excel from
IP address Username
10.10.10.1 A
10.10.10.1 B
10.10.10.1 C
10.10.9.2 D
10.10.9.3 E
10.10.9.3 F
TO
IP address Username
10.10.10.1 A,B,C
10.10.9.2 D
10.10.9.3 E,F
initially,all the IP and username are in difference cells.Finally, if the
usernames are matched in the ip, they will be regroup into one cell as i
mentioned above.
|