If cell value changes in 2 cells

  • Thread starter Thread starter Kashyap
  • Start date Start date
K

Kashyap

Hi, I have a set of tasks to be done when value in E5 changes.. but I need to
do another set of tasks when value in H5 changes as well.. How to go around
it?
 
In your Worksheet Change event put something like this

if Not Intersect(Target,Me.Range("E5")) is Nothing then
'Do the events for E5
end if

Repeat for H5

HTH,
Barb Reinhardt
 
Selec the Worksheet Change event

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Target, Range("$E$5")) Is Nothing Then
'events
End If

If Not Application.Intersect(Target, Range("$H$5")) Is Nothing Then
'events
End If

End Sub
 
in the code for the worksheet's change event ...


Private Sub Worksheet_Change(ByVal Target As Range)

SELECT CASE Target.Address
CASE "$E$5"
' do something
CASE "$H$5"
'do something else
CASE ELSE
END SELECT

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top