Write a formula in Excel VBA

后端 未结 1 1969
醉话见心
醉话见心 2021-01-28 10:22

I\'m struggling to write a formula in Excel VBA.

This is my code:

Dim Formula as Range
Dim Number as Integer

Number = 1

Formula.formula = \"=MAX(IF(LEF         


        
相关标签:
1条回答
  • 2021-01-28 10:53

    You are missing some quotes:

    "=MAX(IF(LEFT(B7:B250,1)=" & Number & ",B7:B250))"
    

    Also, this is an array formula so use .FormulaArray instead of .Formula.

    0 讨论(0)
提交回复
热议问题