Force recalc of formulas saved as text

G

Guest

What is the syntax to emulate re-editing a cell, as in pressing F2 then Enter ?

I have a series of formulas that were built with vba code, but some of the
cells that these were created in must have been formatted as text since the
formulas did not calculate. The formulas are syntactically correct, but I
need to get Excel to treat them as formulas instead of text.

I have changed the formatting to general, and I want to run a simple macro
on the range to force an edit and re-enter of each cell in the range... but I
cannot remember the vba method (or maybe a property?) to accomplish this.

Any help appreciated.

Thanks,

TK
 
C

Chip Pearson

Select the cells in question, the run code like the following:

Sub AAA()
Dim Rng As Range
For Each Rng In Selection.Cells
Rng.Formula = Rng.Formula
Next Rng
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
G

Guest

Beautiful. Just what I needed.

Thanks alot!

TK

Chip Pearson said:
Select the cells in question, the run code like the following:

Sub AAA()
Dim Rng As Range
For Each Rng In Selection.Cells
Rng.Formula = Rng.Formula
Next Rng
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top