group

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
 
R

Ranjit kurian

Hi
please ignore my first query, actually i require something like below..

question
Name Age
a 1/1/2008
a 1/2/2008
b 1/3/2008
b 1/4/2008
c 1/5/2008
e 1/6/2008
f 1/7/2008
f 1/8/2008
f 1/9/2008
f 1/10/2008

and Answer should be like below

Name age1 age2 age3 age4
a 1/1/2008 1/2/2008
b 1/3/2008 1/4/2008
c 1/5/2008
e 1/6/2008
f 1/7/2008 1/8/2008 1/9/2008 1/10/2008
 
B

Bob Phillips

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
 
R

Ranjit kurian

Thanks a lot

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top