在尝试计算连续非空单元格时(在此示例中,第二行)计算语法时出现问题,excel vba。
尝试过.rows(2:2).rows(2).cells(B1:B999)收到错误。
Dim intCount As Integer
intCount = CountA(ActiveSheet.Rows(2, 2))
答案 0 :(得分:3)
CountA
不是VBA函数,它是工作表函数。试试这个:
Dim intCount as integer
intCount = Application.WorksheetFunction.CountA(Activesheet.Rows(2))