R
Ranjit kurian
I have two column i need to separate it as shown below
name age
a 10
a 30
b 20
answer
name age1 age2
a 10 30
b 20
name age
a 10
a 30
b 20
answer
name age1 age2
a 10 30
b 20
Bob Phillips said:Sub Processdata()
Dim LastRow As Long
Dim i As Long
Application.ScreenUpdating = False
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 2 Step -1
If .Cells(i, "A").Value = .Cells(i - 1, "A").Value Then
.Cells(i, "B").Resize(, 200).Copy .Cells(i - 1, "C")
.Rows(i).Delete
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
--
__________________________________
HTH
Bob