VBA Event Worksheet_Change not working

erinmkurtz

New Member
Joined
Sep 8, 2015
Messages
10
Ok, I have super simple code and it refuses to work. I've used this code several times before on other workbooks and has done wonderfully.

Sub Worksheet_Change(ByVal Target As Range)
If Target.Address.Value = "$A$1" Then
Call MyMacro
End If
End Sub

Application.EnableEvents = True (I've triple checked)

My References, Microsoft Scripting Runtime is checked, Microsoft Forms 2.0 Object Library is selected.

Fresh out of ideas. I've read through all of the previous posts about this issue. Any fresh suggestions?

Thanks!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Re: VBA Eveent Worksheet_Change not working

Have you tried ?
Code:
Sub Worksheet_Change(ByVal Target As Range)
 If Target.Address = "$A$1" Then
  Call MyMacro
 End If
End Sub
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Hi erinmkurtz

Change:

Code:
If Target.Address.Value = "$A$1" Then

to:

Code:
If Target.Address = "$A$1" Then

Cheers

pvr928
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

I must have left in the .Value when I was trying to figure out this issue. I did remove it and I am still seeing the same issue.



Have you tried ?
Code:
Sub Worksheet_Change(ByVal Target As Range)
 If Target.Address = "$A$1" Then
  Call MyMacro
 End If
End Sub
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Try running this
Code:
Sub chk()
Application.EnableEvents = True
End Sub
& then try your event code again.
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Check the code is in the appropriate sheet module and make sure you are changing cell A1 on its own. No other cells changed at same time.
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Yes, it is in the correct sheet. I do have two cells changing at the same time (A1, H1), but I've never seen that be an issue before.
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Code:
If Target.Address = "$A$1" Then

This isnt true then
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

Try using this instead:

Code:
If Not Intersect(Target, Range("A1")) Is Nothing Then
    MsgBox "Works!"
End If
 
Upvote 0
Re: VBA Eveent Worksheet_Change not working

How is A1 being changed?
Manually, by formula, or someother way?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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