P
Paul987
I have some code courtesy of a contributor here, that I need to start o
stop on command. My problem is that when I open the sheet, the cod
kicks an error because some other macros havn't finished running yet.
Is there a way I can assign a button that would start/stop this even
code? TIA
Here is the code:
Private Sub Worksheet_Calculate()
Const WS_RANGE As String = "A1:H10"
Static oldvalue
If Me.Range(WS_RANGE) <> oldvalue Then
If Me.Range(WS_RANGE).Value <= 1 Then
MsgBox "Alert"
End If
End If
oldvalue = Me.Range(WS_RANGE).Value
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in
stop on command. My problem is that when I open the sheet, the cod
kicks an error because some other macros havn't finished running yet.
Is there a way I can assign a button that would start/stop this even
code? TIA
Here is the code:
Private Sub Worksheet_Calculate()
Const WS_RANGE As String = "A1:H10"
Static oldvalue
If Me.Range(WS_RANGE) <> oldvalue Then
If Me.Range(WS_RANGE).Value <= 1 Then
MsgBox "Alert"
End If
End If
oldvalue = Me.Range(WS_RANGE).Value
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in