[英]vba insert array formula using vba?
I am trying to insert an array formula into a cell in excel, however I get an error, "unable to set the formula array for the range class" 我试图将数组公式插入excel中的单元格,但是出现错误,“无法为范围类设置公式数组”
Can someone please show me what I am doing wrong here? 有人可以告诉我我在做什么错吗? Thanks. 谢谢。
intRow4 As Integer, _
intRow4 = excWks4.UsedRange.Rows.Count + 1
lastcell = excWks4.Cells(intRow4, 4).Address
theform = "=IF(ISERROR(INDEX('Look Up Supplier Sheet'!$A$1:$G$10004,SMALL(IF(LEFT('Look Up Supplier Sheet'!$B$1:$B$10004,5)=LEFT(" & lastcell & ",5),ROW($B$1:$B$10004)),ROW(1:1)),6)),"""",INDEX('Look Up Supplier Sheet'!$A$1:$G$10004,SMALL(IF(LEFT('Look Up Supplier Sheet'!$B$1:$B$10004,5)=LEFT(" & lastcell & ",5),ROW($B$1:$B$10004)),ROW(1:1)),6))"
excWks4.Cells(intRow4, 5).FormulaArray = theform
FormulaArray has a 255 character limit . FormulaArray的字符数上限为255个 。 Yours is at least 309 characters, depending on the length of lastcell
. 您的字符数至少为309个字符,具体取决于lastcell
的长度。
You could get under 256 characters by shortening your worksheet name. 通过缩短工作表名称,您可以得到少于256个字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.