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):
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))