I use a "Streaming" add-in that forces recalculation every 2 seconds.
I have a Macro that I want to run only when cell A1 changes.
My workbooks are very large and it would be best not to run extra code every 2 seconds
All suggestions are welcomed.
If the sheet recalculates every 2 seconds, is there really any difference between the two routines shown here?
CODE A
CODE B
I have a Macro that I want to run only when cell A1 changes.
My workbooks are very large and it would be best not to run extra code every 2 seconds
All suggestions are welcomed.
If the sheet recalculates every 2 seconds, is there really any difference between the two routines shown here?
CODE A
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Workbooks("WB1.xlsb").Sheets("SHEET1").Range("A1") = "" Then Exit Sub
' Only execute if A1 <> ""
Call Macro1
End Sub
CODE B
VBA Code:
Private Sub Worksheet_Calculate()
If Workbooks("WB1.xlsb").Sheets("SHEET1").Range("A1") = "" Then Exit Sub
' Only execute if A1 <> ""
Application.EnableEvents = False
Call Macro1
Application.EnableEvents = True
End Sub
Last edited by a moderator: