2 change events in one column

punnu07

New Member
Joined
Apr 19, 2015
Messages
34
Hi,

I have an excel file in which in one single column multiple change events are happening. For example on the basis of change in value in cell B9 some code needs to be run and then the basis of value in B10 some code needs to be run but I am not able to keep this 2 events separately. Can you please help me. I am using

If Not Application<gs id="65f64b27-f7c6-4733-aaf8-503fe35efdc6" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">.</gs>Intersect<gs id="7cb10ed6-2d5f-4bc6-be60-56caf8a54d0f" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">(</gs>Range<gs id="e252dbfd-fb6e-4466-a5dd-d61034c046c0" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">(</gs>"B9<gs id="3f7836fc-c799-42cc-bbf4-a5192762d56f" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">:</gs>B10"), Range<gs id="c2c54c02-7b20-4d14-b83d-198a8cdec78d" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">(</gs>Target<gs id="88562209-eabc-44f4-b5ac-93724337944a" ginger_software_uiphraseguid="4450f37e-b1f9-41e7-adb3-8ffff172c6a7" class="GINGER_SOFTWARE_mark">.</gs>Address)) Is Nothing Then
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
See if you can apply something like this to your needs.

Howard

Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("$B$9:$B$10")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub

Dim Rng9 As Range, RNG10 As Range

Set Rng9 = Cells(9, 2)
Set Rng9 = Cells(10, 2)

If Not Rng9 Is Nothing Then
MsgBox "Cell " & Target.Address & " has changed"
End If
  
If Not RNG10 Is Nothing Then
MsgBox "Cell " & Target.Address & " has changed"
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,577
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top