The answer of Charl Pretorius was helpful. After fixing 2 issues, the Macro worked for me. I have added comments where I changed the script.
Note that the Macro needs to be run as often as you want replacements to be made. It would be possible to perform all replacements, but maybe the last reference to a cell should remain.
Sub CombineFormula()
Dim FormulaCell As Range
Set FormulaCell = ActiveCell
Dim StrTemp As String
StrTemp = FormulaCell.Formula
'Do not replace the $ sign in absolute addresses.
'It may be used in text, e.g. in a formula like ="US$"&A1
'Instead, use different adressing modes in the replacement loop
'! StrTemp = Replace(StrTemp, "$", "")
Dim RangeRef As Range
On Error Resume Next
Dim ReplaceBy As String
For Each RangeRef In FormulaCell.Precedents.Cells
'Add in parentheses to maintain correct order of evaluation, e.g. in cases of addition before multiplication
ReplaceBy = "(" + Replace(RangeRef.Formula, "=", "") + ")"
'The order of the following is important
'Replace absolute ranges first, because A$1 is also contained in $A$1
StrTemp = Replace(StrTemp, RangeRef.Address(True, True), ReplaceBy)
StrTemp = Replace(StrTemp, RangeRef.Address(True, False), ReplaceBy)
StrTemp = Replace(StrTemp, RangeRef.Address(False, False), ReplaceBy)
StrTemp = Replace(StrTemp, RangeRef.Address(False, True), ReplaceBy)
Next
FormulaCell.Value2 = StrTemp
End Sub