troubleshooting Question

This code is driving me bonkers!

Avatar of Martin Liss
Martin LissFlag for United States of America asked on
VBAMicrosoft ExcelMicrosoft Office
19 Comments1 Solution106 ViewsLast Modified:
I'm trying to scale up the code found here. To run it you put a 0 in column'B' for each row, and in C9 the SUMPRODUCT formula =SUMPRODUCT(A1:A12*B1:B12). When the ABC sub is run column 'D' should list all the combinations that add to a desired result, which I have hard-coded into the sub as 24. I believe the list should be
8, 16

but when I run the code 10,10,4 and 8,16 are missing. Maybe that's because they involve the last few rows, but if so I can't find the reason why. In my opinion I'm a pretty good VBA programmer and I understand how SUMPRODUCT works, but I've spent days on this and I can't get it to work properly and it's driving me bonkers!

So what I'm looking for here is a correction to the code and an explanation of how the binary matching that the code uses works. I'm using Excel 2010.
Join our community to see this answer!
Unlock 1 Answer and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros