View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default run a macro wehn leaveing a cell ??

In the worksheet code add this (enter a new value in A1 and running total is
updated in B1
Change cells as required.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Range("B1") = Range("B1") + Target.Value
End If
End Sub

--
Cheers
Nigel



"Sparky AKA_Sparkticus" wrote in message
...
Can this be implemented or is there a vba way
i have to in put mileage and calculate total mileage dont want to input a
large list just use one entry point.

i have a sum which is

mileage + previous total = total

i have used a macro to copy new total to previous and move curser to
mileage
ready for a new input but is this the only way or can vab do this after
hitting enter on mileage??

Sparkyman