Consulting

Results 1 to 12 of 12

Thread: sum to the last column with data

  1. #1
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location

    sum to the last column with data

    Hi all

    here is the problem I have data in three random cell per column
    (cells 1-10) everyday I get one column more of data I have to add each row to the end and each column to cell 11 everyday I have to do all this manually what I need is a formula that will Sum each row to the last COLUMN with data +1 and to copy this formula =SUM(A1:A11) to the COLUMN with data .

    all columns have data but not all cells I can post some data if you need it

    thanks for any help

    lneilson

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    With Activesheet
        LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
        .Cells(10,"A").Resize(,LastCol).Formula = "=SUM(A1:A10)"
    End With
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location
    thanks for the reply

    tried your formula and it gave me a circular reference error

    thanks again

    lneilson

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Of course it will, I am trying to stuff it into row 10 not 11

    With Activesheet 
        LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column 
        .Cells(11,"A").Resize(,LastCol).Formula = "=SUM(A1:A10)" 
    End With
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location
    still getting cirlcular reference error
    I posted my page so you can see what your dealing with

    thanks

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Works fine for me on your workbook.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location
    It gives circular reference error always at GQ

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I notice that the workbook contains no code, and the formulae say A1:A11, whereas my solution specifically said A1:A10.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location
    I rearranged it a little I need the total of each column in row 11

    don't what happen to the code I just copied and pasted to a new wk bk

    thanks

    lrneilson

  10. #10
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Post the "new" workbook.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  11. #11
    VBAX Regular
    Joined
    Aug 2008
    Location
    Grayling,Michigan
    Posts
    30
    Location
    here it is

  12. #12
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Okay here is your workbook with the code as a macro. One thing that concerns me is that is the posts above you talk about summing the columns, yet in the new workbook it is indicated that you are seeking the summation of the rows.

    XLD's code sums the columns.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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