View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PC[_3_] PC[_3_] is offline
external usenet poster
 
Posts: 22
Default Procedure loop limitation?

Thanks for your help Guys - got it working


"PC" <paulm DOT c at iol DOT ie wrote in message
...
Hi,

I have created a macro (vba procedure) which runs when a command button is
pressed on a spreadsheet. The procedure performs a certain task then calls

a
second procedure which runs in a continuous loop until it reaches the end

of
a series of active work sheets. At this point the second procedure exits

and
returns control to the first procedure.

An example

Sub Procedure_Name1()
Do something
Call Procedure_Name2
End Sub

Sub Procedure_Name2()
On Error Goto Err_Procedure_Name2
Do some other stuff 'Perform an action on the active sheet
then move to next sheet
Call Procedure_Name2 'Loop until error
Err_Procedure_Name2:
Exit Sub
End Sub


This process works perfect but for some reason it stops after looping 23
times i.e. 23 sheets are updated when the loop stops with no error

message.
Is there some restriction in VBA that prevents a procedure from looping

more
than 23 times.

Any help would be appreciated.

..pc