I am supposing that you have a data in sheet1 and you want result in sheet2. Also, the data is lying in A and B column of sheet1. So the following code will help you in achieving results.
Dim i as long
Do while Sheet1.Cells(i,1)<>""