asmith4035
New Member
- Joined
- May 9, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
I am new to VBA but working hard to learn
I used 2 InputBoxes to get 2 variables, Rows2Insert and InsertAfter. I want to use these variables in a relative formula in an active cell. My attempt, that doesn't work is:
ActiveCell.FormulaR1C1 = "=IF(RC[1]>=insertafter,RC[1]+Rows2Insert,RC[1])"
This is what goes into the cell
=IF(CQ3>=@insertafter,CQ3+@Rows2Insert,CQ3)
Thanks, alan
I used 2 InputBoxes to get 2 variables, Rows2Insert and InsertAfter. I want to use these variables in a relative formula in an active cell. My attempt, that doesn't work is:
ActiveCell.FormulaR1C1 = "=IF(RC[1]>=insertafter,RC[1]+Rows2Insert,RC[1])"
This is what goes into the cell
=IF(CQ3>=@insertafter,CQ3+@Rows2Insert,CQ3)
Thanks, alan