+ Reply to Thread
Results 1 to 4 of 4

Sumif macro

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    87

    Sumif macro

    Hi,

    I need a macro that will find the last row in column "I" and insert a SUMIF formula for:

    =SUMIF(C2: Row above where this formula in "C" column, "C" in row of this formula, I2: Row above where this forumla is entered)

    The last row will vary in each of the sheets this is being done on. It will do this three times on each sheet but I want the ranges to stay the same ...

    For example sheet one:
    Example sheet two

    I32 I will need the SUMIF to be input... which would be
    end range would be different
    =SUMIF( C2:C31, C32, I2,I31 )
    =SUMIF( C2:C44, C45, I2,I44 )

    I33 I will need a SUMIF input with same ranges just different criteria
    =SUMIF( C2:C31, C33, I2:I31 )
    =SUMIF( C2:C44, C46, I2,I44 )

    I34 same again
    =SUMIF( C2:C31, C34, I2:I31 )
    =SUMIF( C2:C44, C47, I2,I44 )

    How would this be done in macro form for the sum if formulas?
    Last edited by aaaaaaiden; 02-10-2014 at 08:46 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Sumif macro

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Sumif macro

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Messed around with the co ords and managed to get it to work! thank you very much +rep'd

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Sumif macro

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.


    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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. [SOLVED] Adapt A Sumif Macro to A Vlookup Macro
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2012, 06:22 PM
  2. Sumif Macro instead of formula
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2011, 02:44 PM
  3. macro for sumif formula
    By supamari0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2006, 04:50 PM
  4. SUMIF macro problem
    By fantomas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2005, 04:10 AM
  5. SUMIF Macro Needed
    By fantomas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2005, 02:13 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