Workbook_SheetChange simple example will not work

nikifi

New Member
Joined
Jan 4, 2011
Messages
17
I am trying to have cell B4 on sheet4 update to today's date if J3 changed for worksheet named "Review_Tracking". It seems simple and I can't figure out why it doesn't work. I am a complete newbie to VBA coding, just starting looking at it today. Thanks!

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
 If Sh.Name = "Review_Tracking" And Target.Address = "$J$3" Then Sheet4.Range("$B$4") = ToDate
 
 
 End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Sorry, I meant for it to say Today. That is the only part of the code I had hand modified after copying it from my VBA editor. My actual code has Date in it and it does not work. I used Date in some other code and it displayed the time as well, but I only want the date so I found somewhere that says to use ToDay, which is what I meant to type...

So, code is still not working. Any help will be appreciated. Thanks
 
Upvote 0
Even when I change Target Address and use a different method it does not work. It is something fundamental that I dont understand.
 
Upvote 0
Make sure that events are enabled. In the VBE press CTRL + G and in the Immediate Window type

Application.EnableEvents=True

and press Enter.

Obviously check that macros are enabled as well.
 
Upvote 0
Thanks, I figured what the issue was. I was in a specific worksheet instead of the workbook. I told you I was new :-). Thanks for the help
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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