Enter a value and calculate in same cell

  • Thread starter Thread starter bb
  • Start date Start date
B

bb

Is it possible to enter a value in a cell and have a
calculation performed based on the entered value, within
that same cell?

ex.
A1 = [Enter the value] * 5
 
Hi
this is only possible with VBA using an event procedure. Is this a
possible solution for you?
 
Depends on how advanced. I have done research and coding
in Access, so it won't be completely foreign.

Thanks
-----Original Message-----
Hi
this is only possible with VBA using an event procedure. Is this a
possible solution for you?

--
Regards
Frank Kabel
Frankfurt, Germany

Is it possible to enter a value in a cell and have a
calculation performed based on the entered value, within
that same cell?

ex.
A1 = [Enter the value] * 5

.
 
Hi
not that advanced :-)
As a starting point for further information have a look at
http://www.cpearson.com/excel/events.htm

For your example put the following code in your worksheet module (not
in a standard module). To get into the worksheet module right-click on
the tab name and choose 'Code'

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
application.enableevents = false
With Target
If .Value <> "" Then
.value = .value * 5
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

Depends on how advanced. I have done research and coding
in Access, so it won't be completely foreign.

Thanks
-----Original Message-----
Hi
this is only possible with VBA using an event procedure. Is this a
possible solution for you?

--
Regards
Frank Kabel
Frankfurt, Germany

Is it possible to enter a value in a cell and have a
calculation performed based on the entered value, within
that same cell?

ex.
A1 = [Enter the value] * 5

.
 
Depending on what you want in the end..........you can put a small TEXT box
inside a cell and put a formula in the TEXT box referencing another helper
cell which would multiply your primary cell *5.........this would allow you
to have both the basic number and the multiplied number in the same
"cell"........you can format the TEXT box to make the borders white so they
don't show..........

Vaya con Dios,
Chuck, CABGx3
 
Back
Top