Vishu wrote:
I have data in around 200 cells. I need to go to each cell and press “F2” button and then “Enter” button. Can I have macro codes,
that should perform above task in selected cells. I could not get these code by recording.
Of course, this is needed, for example, when you entered numbers or formulas into cells originally formatted as Text, then you change the format to General or some other numeric formula. As we know, Excel does not automatically change the cell contents immediately.
We must "edit" each cell by pressing F2, then Enter.
FYI, if your original data are constants, you can simply put the number 1 into some cell and copy it, select the cells to "edit", right-click and click on Paste Special, select Multiply, and press OK. Then you can delete the number 1.
But if you have formulas, you can use the following macro. Select the range of cells to change first. The formula works only for cells with constants and non-array-entered formulas. But then, so does your procedure of pressing F2, then just Enter.
Sub reEnter()
For Each r In Selection
r.Formula = r.Formula
Next
End Sub