Repeat a macro until the last line is empty or repeat it 1400 time

M

marita

I have done a macro that insert 20 lines, do some copying exercises and stops
1 line down the insertet ones. Instead of repeat the command run for about
1400 times I like to configure a "loop" that runs this macro until there's no
more lines to copy.
Another solution could be to repeat the macro 1400 times, maybe that it is
easier to write a WBA code for.
 
B

Bob Phillips

Can you post the code for a single iteration of this loop so that we can
work on that?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

marita

I found the code for a repeat macro (specific times) in a similar question
and that helped me. I´t's not so sofisticated solution but good enogue.
XXX=name of this repeat macro, NNN=name of the macro I like to repeat.

Sub XXX()
For c = 1 To 1400
Call NNN
Next c
End Sub

---------------------------------------------------------------------------------------------
 
B

Bob Phillips

You might find that that messes up if you insert in the middle of the data
that you are looping through. For that reason it is better to move bottom up


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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