What I understand from your sample data is that you want to remove the duplicates from column A and replace it with the value from column B.
Assuming you used cells A1 to B6 for this, I used the formula's:
C2: =IF(A2=A1,B2,A2) drag formula down
D2: =IF(A2=A1,"",B2) drag formula down
This will put the desired data in column C and D, which you can then copy/pastespecial as values over column A and B. Remove column C and D afterwards.
Is this what you are after?