Can I enter data into an Excel cell as a formula, but keep only the resulting value?

mHurley

I have data to enter into cells that is the result of some basic addition. Rather than screwing up the addition in my head, I'd like to just type the addition into a cell, but without keeping the formula.

So, is there a way to type 9+9 into a cell, and have the cell's contents be "18" and NOT "9+9," NOR "=sum(9+9)?"

Scott Craner

You could use vba. Using a Worksheet_Change event like this:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo cleanup
Application.EnableEvents = False
If Not Intersect(Range("A:A"), Target) Is Nothing Then
    Target.Value = Me.Evaluate(Target.Value)
End If
Application.EnableEvents = True
Exit Sub

cleanup:
Application.EnableEvents = True
End Sub

Put this in the worksheet code of the worksheet you want. Change the Intersect Range("A:A") to that of the cells in which you want it to fire.

As is, If I type 9+9 in A1 it replaces it with 18.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Excel formula is only showing the formula rather than the value within the cell in Office 2010

From Dev

How to change a formula according to cell value in excel?

From Dev

Excel IF Formula varififying one cell has data and another cell has specific value

From Dev

How can multiply a value I enter in an excel cell by a constant number, with result on appearing on same cell?

From Dev

How do I keep the cell blank in excel instead of showing a formula until data is entered?

From Dev

If a cell in Excel contains an array formula (like `={1,2,3}`) can I extract the elements of the array with VBA

From Dev

Excel - Replace cell link in formula with value in cell

From Dev

how can I add the left cell and the upper cell using a formula in microsoft excel?

From Dev

Can Excel use formula-input data for cell references?

From Dev

Run formula only If cell contains a value

From Dev

Excel formula is only showing the formula rather than the value within the cell in Office 2010

From Dev

How can I only count cells if a different cell is a specific value?

From Dev

VBA to only keep cell value before space

From Dev

Can I use an excel formula to extract the link location of a hyperlink in a cell?

From Dev

Can Excel 2013 show the formula instead of the value only in certain cells?

From Dev

Excel Changes sheets when I enter value into any cell

From Dev

Excel formula to alter cell's background color but keep its current value?

From Dev

Excel cell value and formula bar display different data

From Dev

Excel Formula Assign Value based on Color of Cell

From Dev

Enter data in / update cell by button only

From Dev

How can I restrict the decimal count in an Excel cell with an "Average" formula?

From Dev

Excel - Pivot Table - Formula Sum a cell only if other cell fulfill an specific value

From Dev

Excel: Keep *first* calculated value in cell and ignore/delete formula afterwards?

From Dev

Excel - Inserting cell value in formula column name

From Dev

Execute the formula Only if we feed in to the cell - No "0" value - Excel 2010

From Dev

How can I write an excel formula to return a value from a range based on the contents of a cell?

From Dev

How do I create a formula in excel that searches for a value in row, and then takes the value from another cell in that column?

From Dev

Formula if cell = value to carry out formula else...Excel VBA

From Dev

IF/IFS Formula in excel is resulting in "formula parse error"

Related Related

  1. 1

    Excel formula is only showing the formula rather than the value within the cell in Office 2010

  2. 2

    How to change a formula according to cell value in excel?

  3. 3

    Excel IF Formula varififying one cell has data and another cell has specific value

  4. 4

    How can multiply a value I enter in an excel cell by a constant number, with result on appearing on same cell?

  5. 5

    How do I keep the cell blank in excel instead of showing a formula until data is entered?

  6. 6

    If a cell in Excel contains an array formula (like `={1,2,3}`) can I extract the elements of the array with VBA

  7. 7

    Excel - Replace cell link in formula with value in cell

  8. 8

    how can I add the left cell and the upper cell using a formula in microsoft excel?

  9. 9

    Can Excel use formula-input data for cell references?

  10. 10

    Run formula only If cell contains a value

  11. 11

    Excel formula is only showing the formula rather than the value within the cell in Office 2010

  12. 12

    How can I only count cells if a different cell is a specific value?

  13. 13

    VBA to only keep cell value before space

  14. 14

    Can I use an excel formula to extract the link location of a hyperlink in a cell?

  15. 15

    Can Excel 2013 show the formula instead of the value only in certain cells?

  16. 16

    Excel Changes sheets when I enter value into any cell

  17. 17

    Excel formula to alter cell's background color but keep its current value?

  18. 18

    Excel cell value and formula bar display different data

  19. 19

    Excel Formula Assign Value based on Color of Cell

  20. 20

    Enter data in / update cell by button only

  21. 21

    How can I restrict the decimal count in an Excel cell with an "Average" formula?

  22. 22

    Excel - Pivot Table - Formula Sum a cell only if other cell fulfill an specific value

  23. 23

    Excel: Keep *first* calculated value in cell and ignore/delete formula afterwards?

  24. 24

    Excel - Inserting cell value in formula column name

  25. 25

    Execute the formula Only if we feed in to the cell - No "0" value - Excel 2010

  26. 26

    How can I write an excel formula to return a value from a range based on the contents of a cell?

  27. 27

    How do I create a formula in excel that searches for a value in row, and then takes the value from another cell in that column?

  28. 28

    Formula if cell = value to carry out formula else...Excel VBA

  29. 29

    IF/IFS Formula in excel is resulting in "formula parse error"

HotTag

Archive