我有以下代码
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-54]C[-14]:R[-54]C[90],RC[-4])"
我想用变量“total”替换 90,我尝试了这个但没有成功:
Dim total as Integer
total=Inputbox("Enter a number")
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-54]C[-14]:R[-54]C[ " & total & " ],RC[-4])"
感谢您的帮助
您需要删除括号中的空格。
Dim total as Integer
total=Inputbox("Enter a number")
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-54]C[-14]:R[-54]C[" & total & "],RC[-4])"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)