+ Reply to Thread
Results 1 to 5 of 5

Macro and summarizing data

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Uppsala
    MS-Off Ver
    Excel 2010
    Posts
    24

    Macro and summarizing data

    Hi,

    I recently got great feedback about an issue I had with how to distribute data to several tabs based on whats in column A.
    http://www.excelforum.com/excel-prog...o-another.html

    Now I am in need of more help, more specifically with how I can add a summarizing feature to the same macro as before.

    Is it possible to include in the below code that each time I start the macro it distributes the data based on A (like it does right now) but that it sums up the values of each item on a seperate row?
    Below pic shows kind of what I am after.

    desired result.png


    Please Login or Register  to view this content.

    Thanks!

    /Ejh
    Attached Files Attached Files
    Last edited by Ejb123erok; 03-31-2014 at 01:59 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,642

    Re: Macro and summarizing data

    There is a nice tool for it (soobtotals in data ribbon). Of course it can be added to your macro:
    Please Login or Register  to view this content.
    More natural location for thus macro eould be in normal module, not in the sheet code.

    PS. Please edit your post and use code tags - read in forum rules if you don't know how.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Uppsala
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Macro and summarizing data

    Thanks for the help kaper, I appreciate it. Did edit the OP and added the code tags. Must've forgot initally.

    I have three follow up questions:
    - How do I make the macro add a row after each item is summarized, so it doesn't look to cluttered when there are a lot of rows and different items?
    - Is it possible to either use something else than the subotals? It definitely gets the job done but in terms of design I would like it to just summarize each item on a row with out the left side 1,2,3 subtotal options showing.
    - Just for educational purposes, why is it more natural having this macro in the normal module than in the sheet code? (yes, I am a newbie )

    thanks!

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,642

    Re: Macro and summarizing data

    Hi,
    You can either scan already prepared sheets for rows with sums and add rows below or let's do this from the scratch - hope that code below is quite straightforward.
    Why normal module - sheet module shall be mostly used for sheet objects - embedded shapes buttons etc, as well as handlers of events related to the sheet.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Uppsala
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Macro and summarizing data

    My reply didn't get posted. trying again!

    Many thanks Kaper. It works like a charm and I am going to changed the thread status to solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro summarizing or merge
    By elevisse in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2012, 06:00 AM
  2. Counting and Summarizing Data - Can't get pivot to work, maybe Macro?
    By Mike74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2012, 11:28 AM
  3. Summarizing cell data using Macro
    By Observer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2012, 03:57 PM
  4. Macro for summarizing data per month.
    By queenie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2012, 06:59 AM
  5. Data summarizing!?
    By Crebsington in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2011, 02:10 AM

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