need help in worksheet

S

schak

Hi, I have a excel file with two worksheets. I am entering amount in th
first worksheet for different persons in different orders. In th
second worksheet I have all those persons name in consecutive columns
Now I want to get the individual amount in individual cells. I a
getting the amount in individual cells but it is not in order. like i
in the first worksheet the name 'A' gets two entry in the first row an
the tenth row, the in the second worksheet, the column name'A' get tw
entry in first row and tenth row. Row two to nine are emptys. I don'
want that. I want it consecutive order. How can I do that. I am als
attaching my files. Hope it will clear some my idea

thank

Attachment filename: test.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=54087
 
D

Don Guillett

try this. Notice that, as written, it will do it for sheet3.

Sub getem()
Sheets("sheet3").Range("a2:x1000").Clear
x = Sheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For Each c In Sheets("sheet1").Range("a1:a" & x)
y = Sheets("sheet3").Range(c & ":" & c).Range("a65536").End(xlUp).Row + 1
Sheets("sheet3").Cells(y, c.Value).Value = c.Offset(0, 1)
Next
End Sub
 

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

Top