Highlight numbers whose sum equals a specific cell value vba

sofas

Well-known Member
Joined
Sep 11, 2022
Messages
559
Office Version
  1. 2021
  2. 2019
Platform
  1. Windows
Welcome.
If, for example, I have 10 numbers in a certain column, from A1:A10, for example, in order.


For example, I want to know the sum of the numbers that equal a number in another cell (b2), and let it be 60, so for example, 2 and 58 remain.
5 - 9 - 16 -58 - 2- 6 - 8 - 90 -4 -10

Or, for example, 34 remains 5 -9 - 2 -6 -8 -4
Capture.PNG
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try the file that can be downloaded from here: Dropbox
Load your list in sheet "LAVORO" in B2 and downward
Set the Total to search in A4
Set the allowed tolerance in A1 (default is 0.001)
Press the CERCA button; leave the time out to 60 secs and press CERCA on the userform

The found combinations will be shown from column C
 
Upvote 1
Solution
Very cool idea. I wish the implementation method were without using a userform. It would be enough to press a button, for example
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top