Macro sum between all positive and negative entries to reach a value

hstef

New Member
Joined
Nov 19, 2018
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a column (L) with some negative and positive entries (invoices value).
I have some customers who pay thru bank and does not specify which invoices is paying. And usually do not pay in order.
All i have is paymant's total value.

I need a macro to make calculation in column "L" until it reaches the total value of payment and to highlight the cells that made up the value.
I will put the payment value in "O1".

Column L example:
203.49
224.91
-224.91
239.67
-36.48
-203.49
64.26
-66.96
24.99
-24.99
105.43

<colgroup><col></colgroup><tbody>
</tbody>

Can this be done?
Thank you kindly,
Stef.
 
Here's how the results look:
Excel 2010
Row\Col
A
B
C
D
E
F
G
H
1
Vals+ Count- CountInstanceMatchcheck
(0.00)
2
203.49​
1​
1​
1​
TRUE​
3
224.91​
1​
1​
1​
TRUE​
4
(224.91)
1​
1​
1​
TRUE​
5
239.67​
1​
0​
1​
FALSE​
6
(36.48)
0​
1​
1​
FALSE​
7
(203.49)
1​
1​
1​
TRUE​
8
64.26​
1​
0​
1​
FALSE​
9
(66.96)
0​
1​
1​
FALSE​
10
24.99​
1​
1​
1​
TRUE​
11
(24.99)
1​
1​
1​
TRUE​
12
105.43​
1​
0​
1​
FALSE​
Sheet: Sheet1
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,633
Messages
6,125,925
Members
449,274
Latest member
mrcsbenson

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