Stop excel from converting formula to text csv

2019-07-31 09:37发布

问题:

How do I keep excel from removing my formula inserted into a csv to text?

For example in my csv I have data and have the formula "=ISNUMBER(SEARCH($A$1,B2))" then I open the csv in excel and see the value of the formula. But when I save, the formula is removed and replaces it with the evaluation of the formula, i.e. true.

回答1:

I assume that you have a column of formulas that need to have an "=" added to it... so put your cursor on that column, and then run this macro:

Sub equalAdder()
While ActiveCell.Value <> ""
    ActiveCell.Value = "=" & ActiveCell.Value
    ActiveCell.Offset(1, 0).Activate
Wend
End Sub

How does that work?