VBA code string to cell not working - run time error 1004

后端 未结 1 1524
攒了一身酷
攒了一身酷 2020-12-07 04:37

I\'m trying to accomplish something very simple. Actually it used to run normally but when I changed to windows 7 + Office 2013 it just stopped working.

The followin

相关标签:
1条回答
  • 2020-12-07 04:57

    Use the Range.Formula property with EN-US syntax or Range.FormulaLocal property with your regional locale settings.

    Worksheets("Charts").Cells(2, 7).FORMULA = "=" & "23.45" & "/PL!C" & 2
    Worksheets("Charts").Cells(2, 7).FORMULALOCAL = "=" & "23,45" & "/PL!C" & 2
    

    VBA is very EN-US-centric as providing translation for all regional settings 'on-the-fly' would create a large overhead.

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