Copy and paste macro

B

Bears

I am trying to write a macro to copy the contents of the cell that the
cursor is in and paste it two columns over into all the cells that are
blank from that row and up until the next cell with something in it. I
just can't get the column offset correct- Help would be appreciated.
 
P

paul.robinson

Hi
This should do it without the paste. Untested, so you will probably get
an error if target is on the first row and you want to go up again...

Application.Screenupdating = true
Set target = activecell.offset(0,2)
Do while target.value = ""
target.value = activecell.value
set target = target.offset(-1,0)
Loop
regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top