Auto Calculating in the same cell

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

Guest

Is it possible to enter a number into a cell, have it multiplied by a
specified number, and the result automatically placed in the same cell?
 
Hi,

Something along these lines :

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Set Target = Range("a1")
Target.Value = Target.Value * 3
Application.EnableEvents = True
End Sub


HTH
Carim
 
Oops,

Forgot to restrict to range("A1")

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

Carim
 
Oops,

Forgot to restrict area to range("A1")

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

Carim
 
Back
Top