Previously Used Code Not Working

kbates79

New Member
Joined
Jun 24, 2011
Messages
11
Hello,

I've used this code before in a worksheet; it used to work fine, and now it's not working:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.Offset(0,1) = Now
End If
End Sub

It used to put a date/time stamp in column B whenever I altered column A, but now -- nothing. I'm not sure if I screwed up my Excel settings, or if I'm truly not seeing my error...

Any help is appreciated!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi kbates79,

Welcome to the MrExcel forum!!

The syntax of the code is fine so it must be how it's being executed. As the macro is an event macro it has to be assigned to the tab in question, not put in a normal module. Is this the case? Another possibility may be that the macros are not enabled.

HTH

Robert
 
Upvote 0
Try running this macro to re-enable the events and see if that fixes the problem.

Code:
Sub ReEnable()
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

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