Problem with Worksheet Change Macros

Overkill32

New Member
Joined
May 13, 2011
Messages
49
Hello,

I have a macro that creates a timestamp when i change the value of a cell. Until recently it was working fine but now it's as if excel doesn't start the macro when I change the cell... any pointers?


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Row > 22 Then
If Target.Column = 1 Or Target.Column = 2 Then
If Target.Column = 1 Then
Target.Offset(, 7) = Time
Else
Target.Offset(, 6) = Time
End If
End If
End If
Application.EnableEvents = True
End Sub
 

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... You have likely have your Events Disabled. This can easily happen when you have a code that craps out on you in the middle of running. If you turn off events at the beginning and then the code doesn't complete the events remain off. Copy the code below and run it using the F8 key. It will tell you what the current status of things are and as well it turns on the necessary things to get your Excel working again... Good Luck

Code:
Sub Check_ALL_Then_Reactivate()
'Check Status of each
MsgBox "Application.ScreenUpdating is..." & vbCrLf & Application.ScreenUpdating, , "True or False?"
MsgBox "Application.EnableEvents is..." & vbCrLf & Application.EnableEvents, , "True or False?"
MsgBox "Application.DisplayAlerts is..." & vbCrLf & Application.DisplayAlerts, , "True or False?"
'Now MAKE SURE they are reset to TRUE
With Application
        .ScreenUpdating = True
        .EnableEvents = True
        .DisplayAlerts = True
            
End With
'Application.Calculation = xlManual 'To turn off automatic calculation
Application.Calculation = xlAutomatic 'To turn on automatic calculation
    
End Sub

Hopefully this fixes your issues. If you have any questions about implementing and running the code... Just ask :)

Take Care,
Mark
 
Upvote 0
Yes my events where off. Last time my macro crashed after the line turning it off. It never went back to on. Thx for the help
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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