Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: VBA macro to sum a range from start to last occupied cell

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello,
    Using VBA, How do I sum a range from a starting reference like "P2" to the last occupied cell in that column and put that result in the cell below the last occupied cell.

    Thanks kindly

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Try this

    Code:
    Sub SumIt()
        Range("P65536").End(xlUp).Cells(2, 1) = _
        "=SUM($P:" & Range("P65536").End(xlUp).Address & ")"
    End Sub

Some videos you may like

User Tag List

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
  •