Pianostool
New Member
- Joined
- Dec 4, 2008
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
Hi folks.
I'm trying to put a SUM formula into cell B2 via VBA.
The range of the SUM can vary depending on inputs, so I can't hard cade any cell references into it.
So, the formula I need in B2 is something like:
=SUM(Variable1:Variable2)
Variable1 will be something like "Range("A" & Position1.Row).Offset(2)"
Variable2 will be something like "Range("A" & Position2.Row).Offset(2)"
Position1 and Position2 are cells defined via a search for specific texts. So I have them already defined and working.
Also, once that cell has the formula in it from the code, I would like that cell named as SENDTOTAL.
Any help would be appreciated.
Thanks in advance.
I'm trying to put a SUM formula into cell B2 via VBA.
The range of the SUM can vary depending on inputs, so I can't hard cade any cell references into it.
So, the formula I need in B2 is something like:
=SUM(Variable1:Variable2)
Variable1 will be something like "Range("A" & Position1.Row).Offset(2)"
Variable2 will be something like "Range("A" & Position2.Row).Offset(2)"
Position1 and Position2 are cells defined via a search for specific texts. So I have them already defined and working.
Also, once that cell has the formula in it from the code, I would like that cell named as SENDTOTAL.
Any help would be appreciated.
Thanks in advance.