Algebra within a cell

F

Flash

How do you set-up a formula in a cell that multiplies a constant times the number you insert? Ex. the constant is .315 remains present at all times only the number you insert changes - =.315*(x)
 
P

Peo Sjoblom

You can't unless you use an event macro, if you need a formula
you have to use another cell as help

=0.315*A2

where A2 holds x

you can also put 0.315 in a cell, copy it, select the cel with x and then
paste special and select multiply. But to get this instantly you have to use
something like


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("A2"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = Target.Value * 0.315
Application.EnableEvents = True
End Sub


this would be for cell A2, every time you put a number and press enter it
will be
multiplied by 0.315
To install the macro, right click on the sheet tab where you want this,
select view code
and paste the above, press Alt + Q to close the editor. Replace "A2" with
the cell
where you want this

--

Regards,

Peo Sjoblom

Flash said:
How do you set-up a formula in a cell that multiplies a constant times the
number you insert? Ex. the constant is .315 remains present at all times
only the number you insert changes - =.315*(x)
 

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