Formula

  • Thread starter Thread starter CCSOLinda
  • Start date Start date
C

CCSOLinda

I would like to be able to enter mileage in a cell and have it show up how
much $ it is based on .59 per mile. Is there a way to do this without having
to add a column?
 
Hi,
Let' say you enter the milage in cell A1 in B1 enter the formula as follow

=a1*0.59

if this helps please click yes thanks
 
If by "adding a column" you meant in order to place the 0.59 - then you got
an answer.
If you like to replace the Mileage - into $ based on $ 0.59/Mile - in the
same(!) cell where the Mileage was typed - try the following Event-Macro.
It will, automatically, do the multiplication.
The column should be "Currency" formatted.
============================
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Intersect(Target, Range("A:A")) Then Target = Target * 0.59
Application.EnableEvents = True
End Sub
========
Micky
 
Please note that in placing the 0.59 inside a formula and/or in a code is not
"right".
You should type the 0.59 into a cell and refer the Formula and/or the Macro
to that cell.
In that way you will have to change the $/Mileage in one cell without need
to copy the changed formula along the range.
Micky
 
Back
Top