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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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
Re-enabling the events seemed to work. I'm glad to know now how I can trouble-shoot.

Thanks all!
 
Upvote 0

Forum statistics

Threads
1,216,524
Messages
6,131,176
Members
449,629
Latest member
Mjereza

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