Runtime Error 1004 when replacing formula

后端 未结 1 1908
栀梦
栀梦 2021-01-25 06:02

I am using the following code to add something to a Formula in VBA (for debugging purposes I am using the variable currentFormula, instead of doing it directly):



        
相关标签:
1条回答
  • 2021-01-25 06:25

    CStr formats the number according to the current system locale.
    Formula accepts formulas in English.

    The function that converts numbers to strings in an invariant way is Str. Note that it prepends a space to positive numbers which you might want to remove:

    currentFormula = currentFormula & "+" & LTrim$(Str$(difference))
    
    0 讨论(0)
提交回复
热议问题