+ Reply to Thread
Results 1 to 2 of 2

Sum in a dynamic range

  1. #1
    Alan M
    Guest

    Sum in a dynamic range

    Hi

    I need to produce code to add a formula in a cell at the bottom of a column
    full of data which sums the values in that column. However the number of rows
    in the column may vary. I can see the a formula R1C1 is needed to take the
    Sum function but this requires R1C1 references. How can I change this to
    accept the dynamic range.

  2. #2
    voodooJoe
    Guest

    Re: Sum in a dynamic range

    Alan -

    Sub d()
    With Sheet1.Range("c1")
    .End(xlDown).Offset(1).Formula = "=sum(" & .Address & ":" &
    ..End(xlDown).Address & ")"
    End With
    End Sub


    "Alan M" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I need to produce code to add a formula in a cell at the bottom of a
    > column
    > full of data which sums the values in that column. However the number of
    > rows
    > in the column may vary. I can see the a formula R1C1 is needed to take the
    > Sum function but this requires R1C1 references. How can I change this to
    > accept the dynamic range.




+ 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