Event Procedure tied to a specific cell not working

SJ-NY

Board Regular
Joined
Feb 16, 2008
Messages
156
Hi
I know this had been asked, I want an event procedure to run only when a specific cell is change, such as "A3". I searched the board and modified some code that I found. I have been using the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Dim Myrng As Range<o:p></o:p>
set Myrng = Target.parent.Range("b3")<o:p></o:p>
Range("b10").Value = "Go"<o:p></o:p>
End Sub<o:p></o:p>
i expecpted the procedure to run only when the value is "A3" is changed. The procedure runs when any cell is entered. When I delete the value in "B10" it runs again.

What did I miss.

Thanks

Steve
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B3")) Is Nothing Then
    Target.Parent.Range("B10").Value = "Go"
End If
 
End Sub
 
Upvote 0
Hi
i just tried the macro, it is executing everytime the cell B3 is selected, not when the value is changed. is there additional code required to execute the procedure only after the value in in "B3" is changes?

Thanks
 
Upvote 0
Hi
That fixed it, changing it from "selection change" to "change" was the answer.

Thanks

Steve
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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