Chili SHot
New Member
- Joined
- Jun 1, 2022
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Column A | Column B |
1 | |
2 | |
3 | |
=700-sum(A2:A4) |
The code below is what I want, but I would like to modify the code to use 700 - sum (the column B) and show the result in Column A. Please advise.
Sub MySum()
Dim cr As Long
Dim lr As Long
' Get current row of activecell
cr = ActiveCell.Row
' Get first row of range
fr = ActiveCell.Offset(-1, 0).End(xlUp).Row
' Enter sum formula into activecell
ActiveCell.FormulaR1C1 = "=SUM(R[-" & cr - fr & "]C:R[-1]C)"
End Sub