Dear all,
I have a problem with the
Worksheet_Change Event. The below code (attached to the sheet) calls a macro wich does some calculation. This works fine so far. But the macro in the end shell alter some cells in the actual sheet then. If it does so, the Change Event is called again and the whole routine starts again over. So I am trapped in a endless loop.
Is there a way to aviod this? Like dissabling intermediately the Change Event functionality in the macro?
Best Axel!
Private Sub Worksheet_Change(ByVal Target As Range)
'Do nothing if more than one cell is changed or content deleted
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Row > 3 And Target.Row < 23 And Target.Column > 2 And Target.Row < 28 Then
Application.ScreenUpdating = False
RunUpdateallSpecimenMacro
RefreshHighlighting
Application.ScreenUpdating = True
End If
End Sub
I have a problem with the
Worksheet_Change Event. The below code (attached to the sheet) calls a macro wich does some calculation. This works fine so far. But the macro in the end shell alter some cells in the actual sheet then. If it does so, the Change Event is called again and the whole routine starts again over. So I am trapped in a endless loop.
Is there a way to aviod this? Like dissabling intermediately the Change Event functionality in the macro?
Best Axel!
Private Sub Worksheet_Change(ByVal Target As Range)
'Do nothing if more than one cell is changed or content deleted
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Row > 3 And Target.Row < 23 And Target.Column > 2 And Target.Row < 28 Then
Application.ScreenUpdating = False
RunUpdateallSpecimenMacro
RefreshHighlighting
Application.ScreenUpdating = True
End If
End Sub