Apply a negative until 0 is reached in Excel
Closed
kentster4
Posts
1
Registration date
Wednesday January 28, 2015
Status
Member
Last seen
January 28, 2015
-
Jan 28, 2015 at 06:22 PM
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 - Jan 30, 2015 at 10:54 AM
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 - Jan 30, 2015 at 10:54 AM
Related:
- Apply a negative until 0 is reached in Excel
- How to apply @ in laptop - Guide
- //192.168.l.0 - Guide
- Apply the moderate effect smartart style - Guide
- Xbox-2309-1001-3-0 - Download - Digital stores
- Number to words in excel - Guide
2 responses
RayH
Posts
122
Registration date
Tuesday August 31, 2010
Status
Contributor
Last seen
June 20, 2016
26
Jan 29, 2015 at 01:59 PM
Jan 29, 2015 at 01:59 PM
A single formula or IF's cannot do this as they can only interact with the cell they are located in.
A macro is the way to go.
This will do what you want for that column. Its not the prettiest piece of code and it very specific to your requirement but it does show what is possible.
A command button can be added to the worksheet to call it whenever you need an update to be done.
A macro is the way to go.
This will do what you want for that column. Its not the prettiest piece of code and it very specific to your requirement but it does show what is possible.
Sub rollup() tot = Range("H18") For n = 17 To 12 Step -1 newcell = Cells(n, 8).Value If Abs(tot) > 0 Then If Abs(tot) - newcell >= 0 Then Cells(n, 8).Value = 0 tot = tot + newcell Else Cells(n, 8).Value = newcell - Abs(tot) tot = 0 End If Range("H18") = tot End If Next n End Sub
A command button can be added to the worksheet to call it whenever you need an update to be done.
Awesome thanks. I was able to find the if function to work
RayH
Posts
122
Registration date
Tuesday August 31, 2010
Status
Contributor
Last seen
June 20, 2016
26
Jan 30, 2015 at 10:54 AM
Jan 30, 2015 at 10:54 AM
What was it?