我有以下公式
=eval("=count("&"Sheet1!$H$5:"&wColLastRowAdd("Sheet1","H"))这很好用,其中wColLastRowAdd是给出最后一行的地址的函数
Public Function wColLastRowAdd(worksheetNm As String, colNm As String) As String
wColLastRowAdd = Worksheets(worksheetNm).Range(colNm & Rows.Count).End(xlUp).Address
End Functionand函数将字符串地址转换为公式地址
Function Eval(Ref As String)
Application.Volatile
Eval = Evaluate(Ref)
End Function我现在正在想办法把我的公式变成countif公式。
我就是不能让它工作,这是我最后一次尝试
=eval("=countif("&"Sheet1!$H$5:"&wColLastRowAdd("Sheet1","H"),">0"&")")我只是想不出"“应该放在哪里才能让公式正确求值,我只是一直得到可怕的#值!
发布于 2019-07-10 12:12:52
同样的问题已经通过评论得到了回答,因此这个问题被标记为未回答。所以,我代表Scott Craner在这里回答
您缺少几个&s和"s
=eval("=countif(Sheet1!$H$5:"&wColLastRowAdd("Sheet1","H")&","">0"")")
https://stackoverflow.com/questions/33745225
复制相似问题