【发布时间】:2015-12-01 20:32:11
【问题描述】:
我有
Dim tape, out As Worksheet
Set tape = ThisWorkbook.Sheets("Agg")
Set out = ThisWorkbook.Sheets("output")
out.Cells(1, 2).Value = WorksheetFunction.CountIfs(tape.Range("IG1:IG10000"), "<>" & "", "<>" & " ", "<>" & " ")
所以通常我说的是“如果它不是空白,不是单个空格,不是两个空格,则计数”。我要做的是计算非空白值,同时考虑到单元格中可能存在空格。但是最后一行一直给我这个错误:“无法获取工作表函数类的 Countifs 属性”。我怎样才能让它工作?谢谢!
【问题讨论】:
-
在
worksheetfunction之前添加application.? -
我认为您以错误的方式使用了 countifs..countifs(range,criteria,range2,criteria2,...) 但您使用了 countifs(range,criteria1,criteria2,criteria3,... )
标签: vba excel worksheet-function countif