View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Repeat a marco with number of times or loop until End

Hi Elton,

I see that you checked my second post as the correct answer but based on
your later comment that the loop should run until error and you don't know
how many times that will be then you should replace the loop code with the
following code and then it does not matter if less than or more than 100
loops.

The called sub code can remain as per my previous post.

Sub RunInLoop()

errorFlag = False 'Initialize to false

Do While errorFlag = False
Application.Run "SkyDaysHour_X31_H2_Hour"
Loop

End Sub

--
Regards,

OssieMac