+ Reply to Thread
Results 1 to 2 of 2

macro to repeat a formula a set number of rows apart

  1. #1
    steveo
    Guest

    macro to repeat a formula a set number of rows apart

    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


  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    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).Address & ",100)"
    Next N
    Next Sheet
    End Sub

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1