Macro for Selection Change

  • Thread starter Thread starter NICK
  • Start date Start date
N

NICK

hi all

what i need to do is to have a macro that when cells A5,
B7 and C10 are changed by the user then excel does the
following goal seek.

Range("Aremainder").goalseek Goal:=0, ChangingCell:=Range
("EoS")

i want it automated so that other users who change A5, B7
or C10 do not have to go and press a button, i just want
it to run automatically when those cell are changed.

heaps of thanks
Nick
 
One way:

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


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A5,B7,C10")) Is Nothing Then
Range("Areamainder").Goalseek _
Goal:=0, _
ChangingCell:=Range("EoS")
End If
End Sub
 
Back
Top