Sub hi
Dim i, j
i = 1
j = 1
while(range("B" & i +1).Value <> 0)
If Range ("A" & i).Value <> 0 then
Range ("D" & i).Value = Range ("A" & i).Value
end If
If Range ("D" & i).Value = 0 then
Range ("D" & i + 1).Value = Range ("A" & i).Value
end If
i=i+1
wend
while(range("B" & j).Value <> 0)
Range ("E" & j).Value = Range ("B" & j).Value
j=j+1
wend
End sub