+ Reply to Thread
Results 1 to 3 of 3

Sum and merge based on change in value

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Gulbarga
    MS-Off Ver
    Excel 2007
    Posts
    15

    Smile Sum and merge based on change in value

    Recently I saw the reply given by rylo on 09-09-2010, to XL2008 regarding the Thread: Macro - Sum and merge based on change in value.
    The code provided by rylo is as under:

    Please Login or Register  to view this content.
    I am using a Pentium 4 PC with a 2.40 G.Hz processor and 3 GB RAM. Further, I am using Windows XP SP3 and Office 2007.
    I tried the above referred macro codes given by rylo , in a excel 2007 file having about 14000 records.
    The macro hangs there and does not complete its job, even after about 2 hours.
    The excel.exe uses more than 95% CPU Usage & more than 24356K memory-usage.
    Will you provide me a better macro which works quickly.
    Please help.
    Thanks.
    Last edited by JBeaucaire; 02-10-2013 at 09:40 AM. Reason: Added code tags, as per forum rules. Don't forget!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum and merge based on change in value

    Functions that are fraught with "recalc" woes are a COUNTIF, Merge Cells, and a row by row LOOP that might need to repeats 10s of thousands of times.

    I would suggest data like this be left alone and referenced as a SOURCE for a report you create separately. SUMIF() formulas can collect all the values for a single matching "category". SUMIFS() can collect all the values from one column for multiple tests in other columns.

    A Pivot Table may be the best solution of all.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Gulbarga
    MS-Off Ver
    Excel 2007
    Posts
    15

    Unhappy Sum and merge based on change in value

    I have attached the sample excel file. But please note that the original excel file has more than 14000 records. I want the macro to sum the values in column C(AMT), for each change in value in the column A (CLIENT_CODE) and populate the column E (TOT_AMT) with the calculated sums.
    Please help me.
    Thanks.
    =====================
    Hello everybody. I have attached the revised sample excel file, which is shorter & more explanatory.
    The revised sample excel file contains both the existing data & required output.
    But please note that the original excel file has more than 14000 records.
    Please give me a good macro to achieve this task.
    Thanks
    Attached Files Attached Files
    Last edited by JBeaucaire; 02-11-2013 at 01:00 AM. Reason: I have attached the revised sample excel file, which is shorter & more explanatory.I request the Administrators to delete the sample.xls file originally atached by me. Sorry for the trouble given

+ 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