I have written the below code (as part of a larger code set) to copy a range and paste it in cell Z4 if Z4 is empty. If it isn't empty, I want it to move one cell to the right and paste it in AA4. This should be a loop pasting one cell to the right of the last filled cell.
I have come up with the following which moves one cell to the right, but only once. It doesn't loop. Also, this loop operates within a larger loop....is there anything I must consider for it to be successful?
Can you help me accomplish what I am trying to do?
Range("z4").Select
If Range("z4") = "" Then
ActiveSheet.Paste
Application.CutCopyMode = False
Else
i = 1
Range("z4").Offset(0, i).Select
i = i + 1
ActiveSheet.Paste
Application.CutCopyMode = False
End If
I have come up with the following which moves one cell to the right, but only once. It doesn't loop. Also, this loop operates within a larger loop....is there anything I must consider for it to be successful?
Can you help me accomplish what I am trying to do?
Range("z4").Select
If Range("z4") = "" Then
ActiveSheet.Paste
Application.CutCopyMode = False
Else
i = 1
Range("z4").Offset(0, i).Select
i = i + 1
ActiveSheet.Paste
Application.CutCopyMode = False
End If