Thread: Looping a macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Sony Sony is offline
external usenet poster
 
Posts: 4
Default Looping a macro

That was a good alternative idea. Thank you Dallman Ross.

Sony
"Dallman Ross" <dman@localhost. wrote in message
...
In , Sony
spake thusly:

I want my macro to call on itself at the end and keep performing
the loop 20 times. How can I do that? Any help will be much
appreciated.


You could, instead of calling the macro over and over,
loop through the actions 20 time:

Option Explicit
Sub total_recall()

For N = 1 To 20

'do something

Next 'N
End Sub


Or if you wanted, you could have "do something" turn out
to be to call a different macro.


Option Explicit
Sub total_recall()

For N = 1 To 20

Application.Run "macro_name"

Next 'N
End Sub

-dman-