eMHDfNhuwLhQCzJ
New Member
- Joined
- May 4, 2021
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
When I run this VBA code:
ActiveCell.FormulaR1C1 = "=SUM(RC[-1]:R[14]C[-1])"
It places the following formula in the active cell:
=SUM(H19:H33)
I need to modify that VBA code so that it whatever the active cell is it makes the first reference absolute.
If I was clicked inside C19 it should produce the formula =SUM($B$19:B33)
So if I was clicked inside F19 it should produce the formula =SUM($E$19:E33)
So far I can't figure out how to do this. Can anyone help me figure it out?
ActiveCell.FormulaR1C1 = "=SUM(RC[-1]:R[14]C[-1])"
It places the following formula in the active cell:
=SUM(H19:H33)
I need to modify that VBA code so that it whatever the active cell is it makes the first reference absolute.
If I was clicked inside C19 it should produce the formula =SUM($B$19:B33)
So if I was clicked inside F19 it should produce the formula =SUM($E$19:E33)
So far I can't figure out how to do this. Can anyone help me figure it out?