+ Reply to Thread
Results 1 to 5 of 5

Macro to insert sum function to inconsistent data

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Macro to insert sum function to inconsistent data

    Hi.
    In this workbook SUM EVERY GROUP.xlsx there are many groups of data separated by 3 rows and a text called "total" underneath each group. Since each group is not always the same distance from the previous group therefore it is difficult to write a code in VBA that would detect that specific range of the group and sum it up and continue summing up every following group. I highlighted in yellow all the ranges that need to be summed up via VBA. Again, please keep in mind that these ranges change in size very frequently and therefore the vba code must be very specific.
    Any ideas?

    Thanks in advance.
    Last edited by kosherboy; 09-28-2014 at 05:39 PM.

  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: Macro to insert sum function to inconsistent data

    This should do it since those blank rows are there.

    Please Login or Register  to view this content.
    _________________
    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
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro to insert sum function to inconsistent data

    Quote Originally Posted by JBeaucaire View Post
    This should do it since those blank rows are there.
    Thanks a million, it worked!
    Is it possible for you to tweak the code so that i can see the formula? Fir the first sum i got it to work with the formula by incorporating this into your code:
    Please Login or Register  to view this content.
    However i was having a little trouble with the other two offsets, can you help me with it?

    Thanks again

  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro to insert sum function to inconsistent data

    I got it!
    Please Login or Register  to view this content.
    Thanks again for all your help, your knowledge is very appreciated
    This thread is solved.

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

    Re: Macro to insert sum function to inconsistent data

    Well done on the followup solve... thumbs up.

+ 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. Using a lookup function on inconsistent data locations
    By apex_predetor1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-05-2013, 11:51 AM
  2. [SOLVED] IF function inconsistent--formatting related?
    By copperberry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2011, 05:37 PM
  3. MATCH Function inconsistent in return value
    By Moose8 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-12-2008, 01:06 PM
  4. IF function comare to identical amount but inconsistent results
    By skhuon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2006, 05:15 PM
  5. Inconsistent results with function call....?
    By Dominic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2005, 02:25 PM

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