Easy one ... How to cut and paste rows between sheets?


Posted by Ron Dionne on November 06, 2001 1:39 PM

I want to remove rows of data that have stat errors.
I use the following code to delete the row of data:

finalWB.Worksheets("FT Data").Rows(n).Delete

I would instead like to cut the data and paste it into
another worksheet via VBA and retain formatting. I would
like the pasted data to be one the next line available
in my "Errors" worksheet.

finalWB.Worksheets("FT Data").Rows(n).Cut will cut the data
but
finalWB.Worksheets("Errors").Rows(n).Paste puts the data
on the first line each time. How do I get the data on the
next available line?

Posted by Jack on November 06, 2001 1:47 PM

I had the same problem, cutting a row subject to the word paid in a column and returs to row one and over wrote the prev entry.

I have to offest in a loop and find Text = "" and paste,

Lops are so slow but i never solved a better way and it did work, let me know if you get stuck i might still have the rotten slow code but it did work:

Posted by Barrie Davidson on November 06, 2001 1:49 PM

Try using something like

finalWB.Worksheets("FT Data").Rows(n).Cut Destination:=finalWB.Worksheets("Errors").Range("A65536").End(xlUp).Offset(1, 0)
finalWB.Worksheets("FT Data").Rows(n).Delete

Hope this helps you out.

Regards,
Barrie
Barrie Davidson



Posted by Jack on November 06, 2001 1:56 PM

Idea

Why not select column and find "" the paste as reqd ok will need header row as first find is impossible to find nothing if nothing tthere if see what i mean, but from then on find nothing in Cells(1, 1) will be a snip!

It will work, will it not, will need to activate the found "" cell that will work ok and no loops!Just an idea.