【问题标题】:How to write VLOOKUP formula correctly in Excel VBA? What is the error? [duplicate]如何在 Excel VBA 中正确编写 VLOOKUP 公式?错误是什么? [复制]
【发布时间】:2020-02-04 19:17:54
【问题描述】:

我想要 Range("H1:H70") 中的 'vlookup' 公式

For i = 1 To 70
    Worksheets(1).Range("H"&i).Formula= "=VLOOKUP("F"&i;'anotherSheet'!$A:$C;2;0)"
Next i

【问题讨论】:

    标签: vba vlookup


    【解决方案1】:

    正确的拼写是Sheets(1).Range("H" & i).Formula = "=VLOOKUP(F" & i & ",'anotherSheet'!$A:$C,2,0)"

    根据您的语言设置,您在工作表中键入公式时使用 ; 作为分隔符,但在 VBA 中键入公式时使用 ,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多