Worksheet change event not firing other Sub()

sujittalukde

Well-known Member
Joined
Jun 2, 2007
Messages
520
I am using the following sub, which is running well if run directly:
Code:
Sub PickTaxData()
'code is doing the work
End Sub
Now I want this code to fire when the Cell $Y$6 od sheet 1 is changed.
So in sheet 1 code in Worksheet chage event I wrote a macro:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$Y$6" Then
Exit Sub
End If
If Target.Address = "$Y$6" Then
Call PickTaxData
End If
End Sub

Now when I am changing Cell Y6 of sheet 1, the Sub PickTaxData () is not firing.

Can Someone please help to fix the problem?

regards
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
That could be simplified

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$Y$6" Then Call PickTaxData
End Sub

Make sure that events are enabled. in the code window press CTRL + G to open the Immediate window, type

Application.EnableEvents=True

and press Enter. Then try changing Y6.
 
Upvote 0
Try this

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "Code Triggered"
If Target.Address = "$Y$6" Then Call PickTaxData
End Sub

Do you get a message? Try a MsgBox in your sub as well.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

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