View Single Post
  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
John McGimpsey John McGimpsey is offline
external usenet poster
 
Posts: 11
Default Changing the contents of a cell... dynamically?

one way:

Paste this Event macro in the worksheet_code module (right-click on the
worksheet tab and select "View Code").

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If .Address(False, False) = "A10" Then
Application.EnableEvents = False
.Value = .Value - 25
Application.EnableEvents = True
End If
End With
End Sub


In article ,
"Friendly Indián" wrote:

I am wanting to do something that I don't know if it is
possible. Here is the scenario...

Say cell A10 gets data (numbers) entered into it, for this
example lets say 100, after the focus moves from the cell I want
25 to be automatically subtracted from the number so that it is
actually is 75. How can I do this if it is possible? Thanks.