I have the following code
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-54]C[-14]:R[-54]C[90],RC[-4])"
I want to replace 90 with a variable "total", I tried this but didn't work:
Dim total as Integer
total=Inputbox("Enter a number")
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-54]C[-14]:R[-54]C[ " & total & " ],RC[-4])"
Ty for your help
you need to remove the spaces in the bracket.