+ Reply to Thread
Results 1 to 4 of 4

SUMIF Formula to Macro or VBA

  1. #1
    Registered User
    Join Date
    06-12-2015
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    2

    SUMIF Formula to Macro or VBA

    Hey folks,
    I am having a problem with an excel sheet at work. I deal with large amounts of data on a daily basis and I am sick of locking up Excel with complicated formulas. Am I correct in thinking that using a Macro rather than a Formula would speed up the process and allow me to sift through the data more efficiently? If so, I have the SUMIF formula below but I am new to the Macro scene and cannot seem to figure out how to make it work as a Macro. I am trying to add up the total uses across the country for a specific part. So i basically need to add up "Y-T-D SALES" for each part and put it into "TOTAL USES ACROSS THE COUNTRY" column Any help would be much appreciated. Thanks!!

    =SUMIFS('MASTER'!E2:E14266, 'MASTER'!E2:E14266, 'DONNIE'!D2)
    Attached Files Attached Files

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: SUMIF Formula to Macro or VBA

    Try this for your Test2 code...
    Please Login or Register  to view this content.
    Edit* This will not totally take care of the issue, but might get you farther than you were.
    Last edited by gmr4evr1; 06-12-2015 at 12:28 PM. Reason: Added Info
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-12-2015
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: SUMIF Formula to Macro or VBA

    I applied the above Macro and it looked like it was going to work, but nothing appeared in cell D2. There we no errors or anything, but nothing appeared. Maybe I am entering it wrong or something. I did and ALT-F11 to open the macro page, then pasted your formula, then hit ALT-F11 again, then ALT-F8 and ran the macro. Did I do this correctly?

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: SUMIF Formula to Macro or VBA

    Yes, you did it correctly. I added an edit to my original post that you may not have seen. The code I provided will only get rid of the errors you were getting, it will not display anything in column D. There needs to be more added to the code, but I'm not sure what. I was thinking an IF/Then statement. I did play with this a little bit, but didn't get anything to work....yet. I will continue to try it out as I can, unless someone else provides a solution before I do.

+ 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. Simple SUMIF formula performance problems in macro
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2014, 10:09 AM
  2. [SOLVED] Need a macro instead of SUMIF & COUNTIFS formula
    By Keyvan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-30-2013, 01:26 PM
  3. A macro to create a Sumif formula for different data on a single report
    By pratiksabnis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2013, 06:30 AM
  4. Sumif Macro instead of formula
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2011, 02:44 PM
  5. [SOLVED] macro for sumif formula
    By supamari0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2006, 04:50 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