Hi,
I am writing the custom cell names and their corresponding formulas to a csv file. In the attached excel sheet, all relevant cells including the formula cells have existing and customized cell names, namely, NewPred_1A, NewPred_1B, NewPred_1C, and NewPred_1D. My goal is to retrieve the expression of the cell location D1(NewPred_1D) in terms of custom names of the other three cells, NewPred_1A, NewPred_1B and NewPred_1C. Currently, the expression for D1(or NewPred_1D) is '=A1+B1+C1' by default even if there are custom names for the cells.
What will I do such that D1 will have an expression of '=NewPred_1A + NewPred_1B + NewPred_1C' without manually updating the expression? How can we assign the formula expression of D1 to a variable? I tried this:
FormulaVar = Worksheets(ActiveSheet.Name).Cells(r, c).Formula but didn't work. It still displayed the '=A1+B1+C1' string. It should dislplay the '=NewPred_1A + NewPred_1B + NewPred_1C' string.
I am writing the custom cell names and their corresponding formulas to a csv file. In the attached excel sheet, all relevant cells including the formula cells have existing and customized cell names, namely, NewPred_1A, NewPred_1B, NewPred_1C, and NewPred_1D. My goal is to retrieve the expression of the cell location D1(NewPred_1D) in terms of custom names of the other three cells, NewPred_1A, NewPred_1B and NewPred_1C. Currently, the expression for D1(or NewPred_1D) is '=A1+B1+C1' by default even if there are custom names for the cells.
What will I do such that D1 will have an expression of '=NewPred_1A + NewPred_1B + NewPred_1C' without manually updating the expression? How can we assign the formula expression of D1 to a variable? I tried this:
FormulaVar = Worksheets(ActiveSheet.Name).Cells(r, c).Formula but didn't work. It still displayed the '=A1+B1+C1' string. It should dislplay the '=NewPred_1A + NewPred_1B + NewPred_1C' string.