Algebra

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm not sure if this is even possible, but is there any way to have a cell
have an algebraic equation where entering a number in a specific cell will
run through the equation and spit the number out in that cell? E.g Cell A1
would be "=x+4" so that when you type "2" into cell A1 it would register 6?
It's for work and I can't have the formula routed through something else so
in order to do it I would need it to come out like that, any ideas?
 
You could create a named range (in my example NAME) that includes the cells
to be evaluated this way.

You could then add the following code to the worksheet. Select the tab
name and then right click to VIEW CODE to get the code in the correct place.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("Name")) Is Nothing Then
Application.EnableEvents = False
Target.Value = Target.Value + 4
Application.EnableEvents = True
End If

End Sub
 
Irish3538 said:
I'm not sure if this is even possible, but is there any way to have a cell
have an algebraic equation where entering a number in a specific cell will
run through the equation and spit the number out in that cell? E.g Cell A1
would be "=x+4" so that when you type "2" into cell A1 it would register 6?

For the example you describe, you would simply put the following in A2
(e.g):

=A1+4

You can also give A1 a name so that you could, in fact, type =x+4.
 
Back
Top