+ Reply to Thread
Results 1 to 2 of 2

sumif VBA in different cells

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    6

    sumif VBA in different cells

    I have different sheets and I have changed their names in a workbook

    1<--sheet name
    A B (Column)
    0:00-0:15 1
    0:15-0:30 0
    0:30-0:45 0

    2<--sheet name
    A B (Column)
    0:00-0:15 10
    0:15-0:30 5
    0:30-0:45 6

    3<--sheet name
    A B (Column)
    0:00-0:15 0
    0:15-0:30 7
    0:30-0:45 8

    Total<--sheet name
    A B (Column)

    2 3

    0:00-0:15 10
    0:15-0:30 12
    0:30-0:45 14

    How to make a VBA to do the sumif
    If I type 1 under Cell A2 and 3 under cell B2 in sheet (total), I will get the sumif for both sheet 1, 2 and 3.
    If I type 1 under Cell A2 and 2 under cell B2 in sheet (total), I will get the sumif for both sheet 1 and 2.


    I have used the below but I got no result.

    Please Login or Register  to view this content.

    Thanks
    Last edited by laualice; 04-18-2018 at 10:42 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,877

    Re: sumif VBA in different cells

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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] SUM cells on row below cells containing SUMIF criteria
    By tool_fairy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-13-2015, 03:03 AM
  2. [SOLVED] Shorten SUMIF + SUMIF + SUMIF each with same reference range but different criteria???
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2014, 09:25 PM
  3. SUMIF for non-corresponding cells
    By _nic_v in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-04-2013, 12:25 PM
  4. sumif cells
    By mcjklein in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2012, 07:43 PM
  5. SUMIF - Can I total the value of cells if three other cells = set
    By mg_sv_r in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2005, 12:55 PM
  6. sumif with similar cells
    By Mosqui in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. [SOLVED] Using SUMIF with non-blank cells
    By Peter Aitken in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-10-2005, 11:06 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