ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Repeat a macro until the last line is empty or repeat it 1400 time (https://www.excelbanter.com/excel-programming/414235-repeat-macro-until-last-line-empty-repeat-1400-time.html)

Marita

Repeat a macro until the last line is empty or repeat it 1400 time
 
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.

Bob Phillips

Repeat a macro until the last line is empty or repeat it 1400 time
 
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)

"marita" wrote in message
...
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.




Marita

Repeat a macro until the last line is empty or repeat it 1400
 
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

---------------------------------------------------------------------------------------------

"Bob Phillips" wrote:

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)

"marita" wrote in message
...
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.





Bob Phillips

Repeat a macro until the last line is empty or repeat it 1400
 
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)

"marita" wrote in message
...
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

---------------------------------------------------------------------------------------------

"Bob Phillips" wrote:

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)

"marita" wrote in message
...
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.








All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com