mercredi 1 avril 2015

(Repost) Copy value after If

I have number 1 to 10 in Column A and name in Column B. What I am trying to accomplish is to check the name in cell B2, if empty then it will copy the number from cell A2 to cell H2. But if cell B2 already contains a name then it will copy the number from cell A3 to cell H2 and so on.

here is my code



With Sheets("Sheet6")
.Range("B:B").Find(vbNullString, [B2]).Offset(0, -1).Copy _
destination:=.Range("H2")
End With


the problem is it's copy the next cell below it (A3) not beside it (A2).

thanks


Aucun commentaire:

Enregistrer un commentaire