macro to repeat a formula a set number of rows apart

  • Thread starter Thread starter steveo
  • Start date Start date
S

steveo

Hi guys, does any body have a macro that would repeat a formula a set
number of rows apart (1200) in a column?There's multiple worksheets
grouped together in a workbook and it would be nice if it would repeat
in the same column same location in each. the start would be L25. The
formula is a countif that refers to data in the d column. Each
worksheet has a different end of data in the d column. Any help would
be greatly appreciated. You guys have been right on everything so far.
THANKS! steveo
 
Try this

Sub Macro1()
For Each Sheet In Sheets
For N = 25 To 65536 Step 1200
Sheet.Cells(N, 12).Formula = "=Countif(" & Cells(N, 4).Addres
& ",100)"
Next N
Next Sheet
End Sub

In the example the formula counts if the Cell in col 4 in the same ro
= 100. Just adapt this for your needs
 
Back
Top