Copy/Paste

R

Robert

I have 1500 rows of data in columns A:S
There is always data in columns A:K, the incidence of entries in L:S
varies.
When, for example, there is an entry in column L, row 5, I want to
insert a row immediately after row 5, copy A5:J5 to A6:J6 and copy the
entry in L5 to K6.
When there are entries in columns L,M,N etc, I want to insert the
corresponding number of rows and repeat the above copy/paste routine
accordingly.
Grateful for any advice.
 
M

Myrna Larson

Turn on the macro recorder and insert the rows. Then modify the code to
determine the criteria for the number of rows to insert. BTW, this sort of
thing is best done by processing the rows from the bottom up. If you do it
from the top down, after inserting, say, 3 rows at row 5, what was row 6 is
now row 9, which causes havoc with For/Next loops.
 
R

Robert

Myrna

Many thanks

Robert

Myrna Larson said:
Turn on the macro recorder and insert the rows. Then modify the code to
determine the criteria for the number of rows to insert. BTW, this sort of
thing is best done by processing the rows from the bottom up. If you do it
from the top down, after inserting, say, 3 rows at row 5, what was row 6 is
now row 9, which causes havoc with For/Next loops.
 

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