统计excel vba中的非空单元格
在尝试对一行中的非空单元(在本例中为第二行)进行计数时遇到语法问题,excel vba。
已经尝试.row(2:2).rows(2).cells(B1:B999)收到三个错误。
Dim intCount As Integer intCount = CountA(ActiveSheet.Rows(2, 2))
CountA
不是一个VBA函数,它是一个工作表函数。 尝试这个:
Dim intCount as integer intCount = Application.WorksheetFunction.CountA(Activesheet.Rows(2))