VBA Runtime error 1004 on Cells(..).Formula
excel, vba
Solution
The problem is when a variable is represented as string it will have the system's decimal point. In your case it is a comma so you need to convert it to dot, for example using `replace()` function.
Problem
I can't make this simple command work: ``` Cells(l, 7).Formula = "=" & var1 & " * " & var2 & " * " & var3 & " / 252" ``` I can paste the inspected formula string value in Excel and it works as expected. Cells(l,7) is a proper reference, as I can inspect its value. Inspected formula on debug: "=86710597,9409 * 0,02 * 0,35 / 252"