+ Reply to Thread
Results 1 to 8 of 8

Autosum

  1. #1
    Registered User
    Join Date
    08-26-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    25

    Autosum

    Hi,

    I have a code that looks at separates blocks of distinct cells with an empty line, then inserts a Autosum formula in that line and indicates that it is a subtotal.

    My problem is that instead of auto-summing the numbers corresponding to the distinct block of cells, it sum formula extends to the top of the spreadsheet?

    Besides that problem, is there a smarter way I could write this macro?

    Thanks in advance!!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Autosum

    Quite possibly. I suggest you attach a small sample workbook illustrating how your data are arranged and your desired results.

  3. #3
    Registered User
    Join Date
    08-26-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Autosum

    File attached!

    Basically it separates the data based on the code in column A and subtotals it, the loops through each tab (normally there are ~50 tabs)

    However, each subtotal reaches to the top of the spreadsheet.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Autosum

    Try this. I had to put in some dummy data as you have some odd formatting.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-26-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Autosum

    Quote Originally Posted by StephenR View Post
    Try this. I had to put in some dummy data as you have some odd formatting.
    You've successfully taken my clunker code and turned it into a new model!!

    one again, I really appreciate your help... ur too good!

  6. #6
    Registered User
    Join Date
    08-26-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Autosum

    Quote Originally Posted by StephenR View Post
    Try this. I had to put in some dummy data as you have some odd formatting.
    Quick question, how would I bold and create a line above each subtotal line ??

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Autosum

    Try this. On reflection, you could have used Excel's built-in Subtotal feature.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-26-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Autosum

    Quote Originally Posted by StephenR View Post
    Try this. On reflection, you could have used Excel's built-in Subtotal feature.
    Worked perfectly.. if i was wearing a hat, I would tip it to you, then give it to you :P

    Yes, I tried to implement the autosum feature, but I couldn't do it properly. I'm still learning!

+ 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