+ Reply to Thread
Results 1 to 3 of 3

Dynamic SUMIF in VBA

  1. #1
    Registered User
    Join Date
    02-15-2011
    Location
    McLean, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Dynamic SUMIF in VBA

    Greetings from new member!
    I have some experience in VBA and Excel in general, but this problem has me stumped. I am working with data from Access and creating a heirarchical database, with parent-child relationships. The data is grouped into five main categories. Each of them is further divided into smaller groups and so on until the lowest level of data. The data need to be summed up to the next-higher level. It's easy for the first heirarchy - I wrote the code to put SUM functions to capture the hardcoded raw data below. Now I need to write code that will selectively sum.
    In the attachment, I need to develop code that will add Sub-Major Parts below Major Part 1, but stop at Major Part 2. Then repeat for those below Major Part 2, stopping at Major Part 3. And so on.
    I hope that makes sense to someone. Thanks!
    Attached Images Attached Images

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Dynamic SUMIF in VBA

    A picture might paint a thousand words ... but a sample workbook with some typical data is much more useful for helping develop a solution or a formula.

    You clearly have the sample workbook ...

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-15-2011
    Location
    McLean, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Dynamic SUMIF in VBA

    True, but I was concerned about proprietary data. I was wondering if someone could just give me a hint as to how to write SUMIF functions depending on an index value. I'll keep working it. Thanks for your time.

+ 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