+ Reply to Thread
Results 1 to 6 of 6

Sumif with dynamic range

  1. #1
    Registered User
    Join Date
    06-24-2008
    Posts
    23

    Sumif with dynamic range

    Hi everyone,

    I'm having the hardest time finding a solution thats likely very simple and I'm only able to find very specific solutions to more complex issues. I'm using a vlookup that refers to cell ranges that vary in length.

    I'm currently matching against the entire column which makes my code seem to bog down a bit.


    Please Login or Register  to view this content.

    This formula ends up being filled down across a fixed range of data, but the "CALC" tab varies. I just want to know what exactly I need to do in VBA so that I can have those ranges be dynamic instead of running the formula on the entire column.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Sumif with dynamic range

    Like this?


    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sumif with dynamic range

    You use a sumif with the whole column.

    The formula will be much quicker if you make a range of it (e.g. "=SUMIF('CALC'!$C1:$C2500, 'RULES'!C2, 'CALC'!$B1:$B2500)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    06-24-2008
    Posts
    23

    Re: Sumif with dynamic range

    Thanks Daffodil11 I think that may work. I have various ranges that are going to need this same code. Is this the simplest way to do it? IE I'd need to set up "Ender" for every time I have to pass a variable with a range.

    oeldere, the range changes every time. One run can be 100 lines, the next could be over 10,000.

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Sumif with dynamic range

    I'm stumped. Hmm..

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sumif with dynamic range

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    while you take the whole column it will slow the formula.

    so I suggest you take a defined range (e.g. B10000)

+ 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. Sumif and dynamic range
    By Bpd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2013, 01:36 AM
  2. Sumif and dynamic range
    By Bpd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2013, 01:36 AM
  3. sumif with dynamic value range
    By vinayakg in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-19-2013, 09:08 AM
  4. VBA SUMIF in Dynamic Range
    By Cowzilla in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2012, 05:28 PM
  5. Sumif for dynamic range
    By Praneetbvb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2012, 07:14 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