+ Reply to Thread
Results 1 to 3 of 3

Adding a row at the end of a 'category' and entering formula for summation

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Adding a row at the end of a 'category' and entering formula for summation

    Hello all,


    I have made a spreadsheet to explain what I am trying to achieve:Total.xlsx

    There is a 'Before' and 'After' Sheet

    I have a set of values that belong to different categories, (See Sheet 'Before')

    I need to add a row at the end of each and enter the formulae to do the sum. (See Sheet 'After')


    Can you guys help me with the vba code to do so?

    Thanks in advance

    Lovi

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Adding a row at the end of a 'category' and entering formula for summation

    hi Lovi. i'm not good in VBA, so i used some tricks & recorded the following:

    Please Login or Register  to view this content.
    basically i:
    1) added headers
    2) did a Subtotal function
    3) Ungroup the list from Subtotal
    4) Clear the contents for the headers & a Grand Total from Subtotal
    5) Find "* Total" & replace with "Total", because my Subtotal will give "A Total", "B Total", etc

    there's definitely going to be a better code than this, but you can use this if nothing comes up.
    =)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Adding a row at the end of a 'category' and entering formula for summation

    @ benishiryo,

    Not bad at all.

    You could shorten it to:
    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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