ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2007 wont run 2003 coded sheet_change event. (https://www.excelbanter.com/excel-programming/438616-2007-wont-run-2003-coded-sheet_change-event.html)

Grid

2007 wont run 2003 coded sheet_change event.
 
Have saved book in full macro mode (.xlsm) but the sheet_change event will
only run once and then nothing.Using data validation and comparing the value
of target cell and then offsetting. Have remmed all in the event to only
leave 1 range to no avail. Very confusing that the code will only run for the
first sheet change andthen nothing until it is closed and re-opened.
Some code below.

If Not Intersect(Target, Range("D8:M38")) Is Nothing Then
If Target.Offset(0, -1).Value = Range("P28") Then
If Target.Value < 0 Then
If Target.Value < Range("Q28").Value Then
MsgBox Range("P28") & " cannot work before " &
Range("Q28")
End If
End If
End If
End If

Ideas?

Barb Reinhardt

2007 wont run 2003 coded sheet_change event.
 
Is it possible that you have

Application.EnableEvents = FALSE

somewhere in your code? If so, you've turned off events and they won't be
triggered again until you allow events to be triggered with

Application.EnableEvents = TRUE
--
HTH,

Barb Reinhardt



"Grid" wrote:

Have saved book in full macro mode (.xlsm) but the sheet_change event will
only run once and then nothing.Using data validation and comparing the value
of target cell and then offsetting. Have remmed all in the event to only
leave 1 range to no avail. Very confusing that the code will only run for the
first sheet change andthen nothing until it is closed and re-opened.
Some code below.

If Not Intersect(Target, Range("D8:M38")) Is Nothing Then
If Target.Offset(0, -1).Value = Range("P28") Then
If Target.Value < 0 Then
If Target.Value < Range("Q28").Value Then
MsgBox Range("P28") & " cannot work before " &
Range("Q28")
End If
End If
End If
End If

Ideas?



All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com