Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default If cell value changes in 2 cells

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default If cell value changes in 2 cells

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

"Kashyap" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default If cell value changes in 2 cells

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

--
If this post helps click Yes
---------------
Jacob Skaria


"Kashyap" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default If cell value changes in 2 cells

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


"Kashyap" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
Compare 1 cell to column of cells returning adjacent cells info? Mr. Fine Excel Worksheet Functions 1 April 15th 10 07:36 PM
Sorting cells: a list behind the cells do not move with the cell Ross M Excel Discussion (Misc queries) 2 September 21st 06 12:14 PM
Unmerge cells and place contents of first cell in all cells Amanda Excel Programming 1 September 12th 05 10:52 PM
Copy cells into range of cells until cell change mdeanda Excel Worksheet Functions 1 April 22nd 05 08:41 PM


All times are GMT +1. The time now is 07:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"