Issues with macros and formulas in Excel

前端 未结 2 590
攒了一身酷
攒了一身酷 2020-12-22 06:03

I\'m having problems when inserting a formula from a macro in Excel. I managed to insert exactly the same value that I have on another cell where the formula is working perf

相关标签:
2条回答
  • 2020-12-22 06:27

    Please refer to the answer by Monster for the correct solution to the problem.

    I have to leave this answer here until it is "unaccepted", and then I will be able to delete it.


    To enter locale-dependent formulas, you need to use FormulaLocal:

    Cells(LastRow + 1, 3).FormulaLocal = "=SI.ERROR(BUSCARV(B" & laststr & " , Datos!A2:E52, 3), """")"
    
    0 讨论(0)
  • 2020-12-22 06:40

    Thanks for your replies!!!

    Using FormulaLocal works great!!! What I did was to "translate" the functions names and done!

    Cells(LastRow + 1, 3).Formula = "=IFERROR(VLOOKUP(" & "B" & laststr & " , Datos!A2:E52, 3), """")"
    
    0 讨论(0)
提交回复
热议问题