View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default looping excel macros

Dim i as integer

For i = 1 to 15

do your stuff

next

For more help on required and optional arguments see VBA help on for next


Gord Dibben MS Excel MVP


On Mon, 4 Jan 2010 20:09:32 -0500, "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