我有一个电子表格,需要公开公式以允许用户跟踪报告中提供的数字的计算和/或来源。
.Range("A" & i).Formula = "=COUNTIFS('SpreadsheetA'!J:J,'TEST'!B" & i & ",'SpreadsheetA'!D:D,"" > ""&'Control'!C5)"
除了对测试表和控制表的引用之外,一切正常,其中输出删除了两个撇号。
结果:
=COUNTIFS('SpreadsheetA'!J:J,TEST!B2,'SpreadsheetA'!D:D," > "&Control!C5)
.Range("A" & i).Formula = "=COUNTIFS('SpreadsheetA'!J:J,'TEST'!B" & i & _
",'SpreadsheetA'!D:D,"" > ""&'Control'!C5)"
应该是
.Range("A" & i).Formula = "=COUNTIFS('SpreadsheetA'!J:J,'TEST'!B" & i & _
",'SpreadsheetA'!D:D,"">"" & 'Control'!C5)"
“>”周围不能有空格