'write dynamic formula in cell using vba
Range(A1).Value = "=SUM(Range(B1), Range(B1).Offset(xlToRight))"
I want to write a formula in a cell by using VBA, but I want to make it dynamic.
How can I write this code?
What I've tried is written above.
Solution 1:[1]
try this:
Range("A1").Formula = "=SUM(" & Range("B1").Value & "," & Range("B1").Offset(0, 1).Value & ")"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tibipin |
