nik*_*iko 4 excel vba excel-2003 excel-vba excel-formula
我在Pth列的第二行输入了这些公式:
=(COUNTIF(A$1:A1,A2)=0)+(COUNTIF(B$1:B1,B2)=0)+(COUNTIF(F$1:F1,F2)=0)
Run Code Online (Sandbox Code Playgroud)
当我将它拖到Pth列的第三行时,它会像这样:
=(COUNTIF(A$1:A2,A3)=0)+(COUNTIF(B$1:B2,B3)=0)+(COUNTIF(F$1:F2,F3)=0)
Run Code Online (Sandbox Code Playgroud)
这是我手动做的.如何使用VBA制作它?我试过以下的方式.
cells(Count,"M").formula= "=(COUNTIF(A$1:A1,A2)=0)+(COUNTIF(B$1:B1,B2)=0)+(COUNTIF(F$1:F1,F2)=0)"
Run Code Online (Sandbox Code Playgroud)
但它不起作用.它没有改变
"=(COUNTIF(A$1:A1,A2)=0)+(COUNTIF(B$1:B1,B2)=0)+(COUNTIF(F$1:F1,F2)=0)"
Run Code Online (Sandbox Code Playgroud)
至
"=(COUNTIF(A$1:A2,A3)=0)+(COUNTIF(B$1:B2,B3)=0)+(COUNTIF(F$1:F2,F3)=0)"
Run Code Online (Sandbox Code Playgroud)
当公式随着行的增加而不断变化时,如何将公式插入单元格?
您可以在一行中执行此操作:
range("P2").Copy Destination:=range("P3:P10")
Run Code Online (Sandbox Code Playgroud)
不需要变量,循环,任何东西!