+ Reply to Thread
Results 1 to 11 of 11

Macro that finds all cells which add up to zero

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Macro that finds all cells which add up to zero

    Hi,

    Is it possible to write macro which finds all cells that add up to zero? Thank you!
    A
    1
    2
    3
    4
    -5
    6
    7
    8
    9
    10
    -17
    -8

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro that finds all cells which add up to zero

    do you mean finds all cells with value > zero ? and then ?
    If solved remember to mark Thread as solved

  3. #3
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro that finds all cells which add up to zero

    Hi
    What do you want to do when you have found the cells that = "0"? Or are you saying that you want to count the number of cells that = "0".
    Tony

  4. #4
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    Hi, I would like to get the cells which sum is zero in all combinations. For example, in this case it would be 10+7-17=0 or 2+3-5=0

  5. #5
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    If it would be possible to get for example in different colours them or copy the values in other column.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Macro that finds all cells which add up to zero

    "For example, in this case it would be 10+7-17=0 or 2+3-5=0"

    So you're restricting your number of summands to three? Otherwise:

    1+2+3+4+6+9-17-8=0

    is another one of potentially thousands of solutions (never mind the fact that you don't mention whether each value may be used more than once).

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    For me the one most important thing is to find one way to get zero, doesn't matter from which numbers exactly.

  8. #8
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    The most important thing is to find anything which sums to zero. because I have huge amount of data.

  9. #9
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    At least it can find one, it's ok for me as well, because i have huge amount of data.

  10. #10
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro that finds all cells which add up to zero

    try attached file
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-07-2013
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Macro that finds all cells which add up to zero

    Works amazing, thank you!

+ 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. Macro which finds and copy's cells based on values in other cells.
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2012, 05:11 AM
  2. Need macro that finds and selects blank cells in col A, pastes shape in all
    By salvator in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2011, 01:12 PM
  3. Trying a macro that finds duplicates and performs function on corresponding cells
    By flipn0tic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2011, 11:42 AM
  4. Formula: Drop Down List -> Choose Option Finds Cells & Replace Cells with Cells
    By g00glethis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 01:10 PM
  5. If Cells.Find finds something
    By achidsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2005, 04:05 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