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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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