我想问一下vba excel,我想填写多个单元格的公式,但公式包含文本字符串.
Sub Test() Dim strFormulas(1 To 2) As Variant With ActiveSheet strFormulas(1) = "=ISNUMBER(SEARCH(Apple,B2))" strFormulas(2) = "=ISNUMBER(SEARCH(Orange,B2))" .Range("C2:D2").Formula = strFormulas .Range("C2:D11").FillDown End With End Sub
在第一个我这样做,但因为本地没有文字字符串,所以结果都是假的,因为公式应该是 =ISNUMBER(SEARCH("Apple",B2))
strFormulas(1) = "=ISNUMBER(SEARCH(""Apple"",B2))" strFormulas(2) = "=ISNUMBER(SEARCH(""Orange"",B2))"