I need a cell to equal have of what I put in

L

lili

how do I make a cell equal half of whatever $ amount I put in?
If I type in 23.50 (Accounting format) I want it to say $11.75
 
G

Gary''s Student

You can scale either a single cell or a range of cells ( column, row,
whatever). In an unused cell enter
..5
and copy this cell. Then select the cells you want to adjust and
paste/special with multiply checked.
 
J

JE McGimpsey

To do this automatically would require an event macro:

Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const cdSCALE As Double = 0.5 'change to suit
With Target
If .Count = 1 Then
If .Address(False, False) = "E5" Then 'change E5 to suit
On Error Resume Next
Application.EnableEvents = False
.Value = Application.Round(.Value * cdSCALE, 2)
Application.EnableEvents = True
End If
End If
End With
End Sub

I used Round() since you're talking about currency. If you want
half-pennies, use

.Value = .Value * cdSCALE

instead.


Note that format of cells (other than Text) doesn't affect how inputs
are parsed or stored.
 
Top