Excel VBA公式在图纸之间引用

时间:2018-07-12 21:34:43

标签: excel vba excel-vba formula

我正在尝试将以下代码添加到宏中,以将公式链接到另一张工作表&INDEX(Sheet1!AA$3:Sheet1!AA$18;,但是不知何故,这不起作用。

.Cells(intFirstEmptyCell, 1).FormulaLocal = "=""ORD-""&INDEX(Sheet1!AA$3:Sheet1!AA$18;MATCH(Q" & intFirstEmptyCell & ";Sheet1!AB$3:Sheet1!AB$18;0))&TEXT(COUNTIF(Q$3:Q" & intFirstEmptyCell & ";Q" & intFirstEmptyCell & ");""0000"")"

1 个答案:

答案 0 :(得分:2)

更改

Sheet1!AA$3:Sheet1!AA$18
Sheet1!AB$3:Sheet1!AB$18

...到

Sheet1!AA$3:AA$18
Sheet1!AB$3:AB$18