I have a Sub with variable "porcen" like this:
Dim porcen as Integer
porcen = Cells(1, 1).Value
After some calculations I have 3 variables. Var1, Var2 and Var3 depend on the variable porcen.
ActiveCell.FormulaR1C1 = "=(IF(R[" & var1 & "]C="""","""",((COUNTIF(R[" & var1+ 1 + var2 & "]C:R[" & var1 + 1 & "]C,R[" & var1 & "]C))-(COUNTIF(R[" & var3 & "]C:R[-5]C,R[" & var1 & "]C)))/(" & var2 & ")))"
I don't know why if I change the value in cell(1,1), the result of the formula remains unchanged.
I wish that when I change the value in Cell(1,1) the result also change.
Aucun commentaire:
Enregistrer un commentaire