need help in worksheet

  • Thread starter Thread starter schak
  • Start date Start date
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
 
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
 
Back
Top