Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet change suddenly not working
All,
This morning, I've come in to find that the worksheet change subs on my worksheets are not working. I enabled macros when opening the sheets and everything was working fine last night. When I put a break point on the first line of the sub shown below, it did not trigger - suggesting that a change which I did make did not trigger the event. Help much appreciated. Will Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Dim changecolumn As Integer Dim changerow As Integer Dim changeworker As String On Error GoTo errhandler: Application.ScreenUpdating = False Application.EnableEvents = False For Each cell In Target changecolumn = cell.Column changerow = cell.Row changeworker = 0 If changecolumn = 89 Then Exit For Call change_flag(changerow, 1000, Me, changeworker) Next errhandler: Application.EnableEvents = True End Sub --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet change suddenly not working
Hi
you have probably disabled the application.enablevents. To enable them again put the following line in the Immediate window and execute this line: Application.EnableEvents = True -----Original Message----- All, This morning, I've come in to find that the worksheet change subs on my worksheets are not working. I enabled macros when opening the sheets and everything was working fine last night. When I put a break point on the first line of the sub shown below, it did not trigger - suggesting that a change which I did make did not trigger the event. Help much appreciated. Will Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Dim changecolumn As Integer Dim changerow As Integer Dim changeworker As String On Error GoTo errhandler: Application.ScreenUpdating = False Application.EnableEvents = False For Each cell In Target changecolumn = cell.Column changerow = cell.Row changeworker = 0 If changecolumn = 89 Then Exit For Call change_flag(changerow, 1000, Me, changeworker) Next errhandler: Application.EnableEvents = True End Sub --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet change suddenly not working
Hello Will
Your worksheet_change event only works for changes made on several cells, it will stop otherwise and move to errhandler. In addition if you use an error handler, you should add a "Exit Sub" line before your Errorhandler line. HTH Cordially Pascal "Romanian37 " a écrit dans le message de ... All, This morning, I've come in to find that the worksheet change subs on my worksheets are not working. I enabled macros when opening the sheets and everything was working fine last night. When I put a break point on the first line of the sub shown below, it did not trigger - suggesting that a change which I did make did not trigger the event. Help much appreciated. Will Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Dim changecolumn As Integer Dim changerow As Integer Dim changeworker As String On Error GoTo errhandler: Application.ScreenUpdating = False Application.EnableEvents = False For Each cell In Target changecolumn = cell.Column changerow = cell.Row changeworker = 0 If changecolumn = 89 Then Exit For Call change_flag(changerow, 1000, Me, changeworker) Next errhandler: Application.EnableEvents = True End Sub --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet change suddenly not working
Thanks Frank,
Out of curiosity Other then in another sub, is there any way I could have accidentall switched off events? I've had a look at the other subs in the sheet and can't see where the events cold have been swithced off withou being switched on again? Thanks Will you have probably disabled the application.enablevents. To enable them again put the following line in the Immediate window and execute this line: Application.EnableEvents = Tru -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My formulas in excel are suddenly not working. Help! | Excel Worksheet Functions | |||
My Excel freezes suddenly while working | Excel Discussion (Misc queries) | |||
Sumproduct suddenly not working | Excel Discussion (Misc queries) | |||
HELP!! Macro suddenly not working | Excel Programming | |||
HELP!! Macro suddenly not working | Excel Programming |