End loop macro with count

  • Thread starter Thread starter Jason C.
  • Start date Start date
J

Jason C.

Help! I want to limit the number of times my loop macro iterates to,
for example, 20 times. I have attempted to use a "count" function but
I don't have a working example, I can't locate one, and my attempt
doesn't work.

Can someone please provide a simple way of doing this.

The routine has apprximately 15 sub routines. A count limit that
applies to a specific sub routine will be perfect or one that applies
to the whole routine will be near enough to.

Thanks in advance.
 
Jason,

Try using a For loop. E.g.,

Dim N As Long
For N = 1 To 20
' your code here
Next N


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Back
Top