stephicohu
New Member
- Joined
- Jan 27, 2023
- Messages
- 26
- Office Version
- 365
- Platform
- MacOS
I am new in excel vba and have a question that you have answered previously. I cannot find the answer in your database because I can't remember how I word the question. I have the following code:
Dim Num1 As Integer
Num1 = -10
Range("AO3").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[" & Cstr(Num1)"]:RC[-9], February!RC[-39]:RC[-35])"
What I am trying to do is to place the Num1 into the sum function so I can change the value of Num1. How do I do this without having an error on the value. I have tried many ideas and they have failed. Help!
Dim Num1 As Integer
Num1 = -10
Range("AO3").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[" & Cstr(Num1)"]:RC[-9], February!RC[-39]:RC[-35])"
What I am trying to do is to place the Num1 into the sum function so I can change the value of Num1. How do I do this without having an error on the value. I have tried many ideas and they have failed. Help!