Apply a negative until 0 is reached in Excel
Closed
kentster4
Posts
1
Registration date
Wednesday 28 January 2015
Status
Member
Last seen
28 January 2015
-
28 Jan 2015 à 18:22
RayH Posts 122 Registration date Tuesday 31 August 2010 Status Contributor Last seen 20 June 2016 - 30 Jan 2015 à 10:54
RayH Posts 122 Registration date Tuesday 31 August 2010 Status Contributor Last seen 20 June 2016 - 30 Jan 2015 à 10:54
Related:
- Apply a negative until 0 is reached in Excel
- Apply the intense effect smartart style - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Arrow keys not working in excel - Guide
- Need for speed most wanted 5-1-0 - Download - Racing
- Delete duplicates in excel - Guide
2 responses
RayH
Posts
122
Registration date
Tuesday 31 August 2010
Status
Contributor
Last seen
20 June 2016
26
29 Jan 2015 à 13:59
29 Jan 2015 à 13:59
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 31 August 2010
Status
Contributor
Last seen
20 June 2016
26
30 Jan 2015 à 10:54
30 Jan 2015 à 10:54
What was it?
