Just put your code where I indicated and it will run 15 times then stop.
Hope this helps! If so, let me know, click "YES" below.
Sub RunMacro()
Dim TimesRan As Long
Do Until TimesRan = 15
' put your code here
TimesRan = TimesRan + 1
Loop
End Sub
"Brad" wrote:
I have Excel 2002 and routinely use the macro recorder. I can read the
macros and make simple edits, but never learned to program in VB and my
fortran programming experience is from 30 years ago. After recording a
macro, I want it to loop 15 times before exiting. What lines to I need to
add to the code to start and end the loop? I already have the macro. It
basically inserts a line, totals certain columns and formats one cell.
Brad
.