Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Sum every nth cell
Thanks Thanks: 0 Likes Likes: 0

  1. #11
    New Member
    Join Date
    Jun 2019
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Sum every nth cell

    I used to have it like this but I am adding cells with VBA and it does not sum the new cells

  2. #12
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    4,508
    Post Thanks / Like
    Mentioned
    42 Post(s)
    Tagged
    12 Thread(s)

    Default Re: Sum every nth cell

    Quote Originally Posted by Savvasy View Post
    I used to have it like this but I am adding cells with VBA and it does not sum the new cells
    Ok, try this

    To add from C3 to C52

    Code:
    Sub sum_col_c()
        Dim c As Long, l As String, i As Long
        c = Cells(3, Columns.Count).End(xlToLeft).Column
        l = Evaluate("=SUBSTITUTE(ADDRESS(1," & c & ",4),""1"","""")")
        For i = 3 To 52
            Range("C" & i) = Evaluate("=SUMPRODUCT((MOD(COLUMN(D" & i & ":" & l & i & "),4)=0)*D" & i & ":" & l & i & ")")
        Next
    End Sub
    Regards Dante Amor

  3. #13
    New Member
    Join Date
    Jun 2019
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Sum every nth cell

    I tried your macro but it loses all the sumproduct formulas. It's like I am doing a copy/paste just numbers.

  4. #14
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    4,508
    Post Thanks / Like
    Mentioned
    42 Post(s)
    Tagged
    12 Thread(s)

    Default Re: Sum every nth cell

    Quote Originally Posted by Savvasy View Post
    I tried your macro but it loses all the sumproduct formulas. It's like I am doing a copy/paste just numbers.
    That's the idea. Leaving only the results of the sums, otherwise, would also have the circular error.
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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